fix: handle non-hyphenated GPT-5 model names in detection logic#4535
Open
hztBUAA wants to merge 1 commit intocrewAIInc:mainfrom
Open
fix: handle non-hyphenated GPT-5 model names in detection logic#4535hztBUAA wants to merge 1 commit intocrewAIInc:mainfrom
hztBUAA wants to merge 1 commit intocrewAIInc:mainfrom
Conversation
Model name detection for `is_openai_model`, `supports_stop_words`, and `_is_model_from_provider` only checked for "gpt-" prefix, missing non-hyphenated variants like "gpt5", "gpt5nano", and "gpt5mini" that are used in Azure deployment names. This caused `response_model` to be ignored for these models. Add "gpt5" to prefix lists alongside "gpt-" so both naming conventions are recognized. Fixes crewAIInc#4478
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Author
|
Thanks for the review and feedback. I am following up on this PR now and will either push the requested changes or reply point-by-point shortly. |
Author
|
Quick follow-up: I am reviewing the feedback and will update this PR shortly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4478
"gpt5"prefix to model detection logic alongside"gpt-"so non-hyphenated GPT-5 model names (e.g.gpt5,gpt5nano,gpt5mini) are correctly recognized as OpenAI modelsis_openai_modelcheck inAzureCompletion.__init__to detectgpt5*variantssupports_stop_words()to treatgpt5*models the same asgpt-5*models_is_model_from_provider()for bothopenaiandazureprovidersContext
When using Azure OpenAI with a deployment named
gpt5nano,gpt5, etc., the model detection logic only checked for the"gpt-"prefix. This causedis_openai_modelto beFalse, which in turn causedresponse_model(Pydantic structured output) to be ignored.Test plan
test_azure_gpt5_non_hyphenated_model_detection— verifiesis_openai_modelandsupports_function_calling()forgpt5,gpt5nano,gpt5minitest_azure_gpt5_non_hyphenated_models_do_not_support_stop_words— verifies stop words are correctly disabled for non-hyphenated GPT-5 names