Skip to content

Add GPT-5 support #150281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2025
Merged

Add GPT-5 support #150281

merged 1 commit into from
Aug 8, 2025

Conversation

Shulyaka
Copy link
Contributor

@Shulyaka Shulyaka commented Aug 8, 2025

Proposed change

Add GPT-5 support

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Aug 8, 2025

Hey there @balloob, mind taking a look at this pull request as it has been labeled with an integration (openai_conversation) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of openai_conversation can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign openai_conversation Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for GPT-5 models to the OpenAI Conversation integration, extending the existing reasoning model functionality to include new GPT-5 specific features. The changes introduce verbosity control for GPT-5 models and update configuration options to accommodate the new model family.

Key Changes

  • Adds GPT-5 model support with verbosity configuration option
  • Updates test data to include GPT-5 model references and new configuration parameters
  • Extends reasoning model logic to support both "o" and "gpt-5" model prefixes

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
const.py Adds CONF_VERBOSITY constant and RECOMMENDED_VERBOSITY default value
config_flow.py Updates configuration flow to handle GPT-5 models with verbosity settings and different reasoning effort options
entity.py Extends model handling logic to support GPT-5 models with verbosity and reasoning parameters
strings.json Adds UI strings for "minimal" reasoning effort option and verbosity selector
test_config_flow.py Updates test cases to include GPT-5 models and new configuration parameters
conftest.py Updates test configuration to use GPT-5 model reference

@michnovka
Copy link

reasoning models do not support temperature nor top P. Maybe this PR could be used to move these settings to model-specific only for gpt4 models? If you use non-default temp or topp with oX or gpt5 models, you will only get errors from OpenAI API

@Shulyaka
Copy link
Contributor Author

Shulyaka commented Aug 8, 2025

You are right, but let's get this out of scope of this PR.

@@ -346,14 +348,18 @@ async def _async_handle_chat_log(
if tools:
model_args["tools"] = tools

if model_args["model"].startswith("o"):
if model_args["model"].startswith(("o", "gpt-5")):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if reasoning will be default included in future models and we should consider negating the check in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most probably.

@balloob balloob merged commit 91a1ca0 into home-assistant:dev Aug 8, 2025
34 checks passed
@Shulyaka Shulyaka deleted the openai_gpt_5 branch August 8, 2025 18:51
@balloob balloob added this to the 2025.8.1 milestone Aug 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAI: reasoning models not working - Error talking to OpenAI: Error code: 404 OpenAI: gpt5 reasoning mode not supported
4 participants