Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@plehoux
Copy link

@plehoux plehoux commented Nov 14, 2025

Models like gpt-5-search-api were incorrectly matching the gpt-5 pattern and getting temperature=1.0, when they should match the -search pattern and get nil.

Reordered conditions to check for -search models first, ensuring the more specific pattern takes precedence.

What this does

Fixes a bug in normalize_temperature where the condition order caused search models in the GPT-5 family (e.g., gpt-5-search-api) to incorrectly receive temperature=1.0 instead of nil.

The fix reorders the pattern matching so the more specific -search check happens before the broader gpt-5 check, ensuring search models don't accept the temperature parameter as required by the OpenAI API.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Performance improvement

Scope check

  • I read the Contributing Guide
  • This aligns with RubyLLM's focus on LLM communication
  • This isn't application-specific logic that belongs in user code
  • This benefits most users, not just my specific use case

Quality check

  • I ran overcommit --install and ⚠️ some hooks failed, but in files unrelated to the fix.
  • I tested my changes thoroughly
    • For provider changes: Re-recorded VCR cassettes with bundle exec rake vcr:record[provider_name]
    • All tests pass: bundle exec rspec
  • I updated documentation if needed
  • I didn't modify auto-generated files manually (models.json, aliases.json)

API changes

  • Breaking change
  • New public methods/classes
  • Changed method signatures
  • No API changes

Models like gpt-5-search-api were incorrectly matching the gpt-5
pattern and getting temperature=1.0, when they should match the
-search pattern and get nil.

Reordered conditions to check for -search models first, ensuring
the more specific pattern takes precedence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant