fix(azure): omit temperature for unrecognised deployment names - #3018
Open
Aftabbs wants to merge 4 commits into
Open
fix(azure): omit temperature for unrecognised deployment names#3018Aftabbs wants to merge 4 commits into
Aftabbs wants to merge 4 commits into
Conversation
AzureOpenAI users frequently pass a deployment name (e.g. "gpt5-prod-eu") as the `model` argument. When that string is absent from the model catalogue, `ModelDataRegistry.get()` returns a default `DeepEvalModelData` whose `supports_temperature` is `True`, so temperature was forwarded to the API — causing 400 errors for newer models that do not accept it. Extend the existing temperature guard to also cover models that are not found in the catalogue: we cannot confirm temperature support for unknown deployment names, so we omit it defensively. Closes confident-ai#3015
|
@Aftabbs is attempting to deploy a commit to the Confident AI Team on Vercel. A member of the Team first needs to authorize it. |
Reformat the temperature-suppression condition so black passes: wrap the two-clause `or` onto separate lines inside parentheses (line was 91 chars, black limit is 88). Also move the `model not in OPENAI_MODELS_DATA` check first to make the short-circuit intent clearer — when the deployment name is absent from the catalogue we suppress temperature immediately without inspecting model_data. Logic is unchanged from the previous commit: unknown Azure deployment names (not in OPENAI_MODELS_DATA) and known reasoning models (supports_temperature is False) both get temperature=None. Signed-off-by: Aftabbs <aftabbs.wwe@gmail.com>
Pre-existing lint failure: .scripts/release.py was not black-compliant, causing CI to fail on all open PRs. Format-only change, no logic change.
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 #3015.
Azure users commonly pass a deployment name (e.g.
gpt5-prod-eu,my-gpt4-deployment) as themodelargument instead of the canonical model name. When that string is absent from theOPENAI_MODELS_DATAcatalogue,ModelDataRegistry.get()falls back toDeepEvalModelData()whosesupports_temperaturedefaults toTrue, sotemperature=0.0is forwarded to the API. Newer Azure-hosted models (GPT-5 family and any future model) reject thetemperatureparameter and return a 400 error.Root cause
The guard only fires when
supports_temperatureis explicitlyFalse(i.e. a known reasoning model). An unrecognised deployment name returns the defaultDeepEvalModelData()withsupports_temperature=True, so the guard never fires and temperature is sent regardless.Fix
Two cases now correctly suppress temperature:
supports_temperature=Falseexplicitly (o-series).Known standard models (gpt-4o, gpt-4-turbo, etc.) remain unaffected because they are in the catalogue.
Test plan
TestAzureModelTemperature::test_unknown_deployment_name_temperature_is_none– unrecognised model name →temperature is Noneby default.TestAzureModelTemperature::test_unknown_deployment_name_explicit_temperature_also_none– user-supplied temperature still dropped for unrecognised names.