Skip to content

Conversation

@Abhinavexists
Copy link
Contributor

@Abhinavexists Abhinavexists commented Nov 18, 2025

Fixed a bug where GPT-5 temperature validation was case-sensitive, causing issues when users
specified Azure deployment names or model names in uppercase (e.g., "GPT-5-2025-01-01", "GPT-5-NANO"). The validation now correctly handles model names regardless of case.

Changes made:

  • Updated validate_temperature() method in BaseChatOpenAI to perform case-insensitive
    model name comparisons
  • Updated _get_encoding_model() method to use case-insensitive checks for tiktoken encoder
    selection
  • Added comprehensive unit tests to verify case-insensitive behavior with various case
    combinations

Issue: Fixes #34003

Dependencies: None

Test Coverage:

  • All existing tests pass
  • New test test_gpt_5_temperature_case_insensitive covers uppercase, lowercase, and
    mixed-case model names
  • Tests verify both non-chat GPT-5 models (temperature removed) and chat models (temperature
    preserved)
  • Lint and format checks pass (make lint, make format)

@github-actions github-actions bot added integration Related to a provider partner package integration openai fix and removed fix labels Nov 18, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 18, 2025

CodSpeed Performance Report

Merging #34012 will not alter performance

Comparing Abhinavexists:openai-case-sensitive (c24378f) with master (32bbe99)

Summary

✅ 6 untouched
⏩ 28 skipped1

Footnotes

  1. 28 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix integration Related to a provider partner package integration openai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BaseChatOpenAI handles temperature removal only for lower case names of reasoning models

1 participant