Skip to content

add GPT-5 model constants and reasoning validation #1062

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 11, 2025

Conversation

behzadsp
Copy link
Contributor

@behzadsp behzadsp commented Aug 9, 2025

Add GPT-5 model constants and reasoning validation

This PR adds support for OpenAI's newly released GPT-5 model series and extends the existing reasoning model validation to include GPT-5 models.

Model Constants Added:

  • GPT5 - Main GPT-5 model (gpt-5)
  • GPT5Mini - Smaller variant (gpt-5-mini)
  • GPT5Nano - Fastest variant (gpt-5-nano)
  • GPT5ChatLatest - Latest chat-optimized variant (gpt-5-chat-latest)

Also extended ReasoningValidator to include GPT-5 series models as GPT-5 models now validate parameter restrictions like O1/O3/O4 series:

  • logprobs not supported
  • temperature, top_p, n fixed at 1
  • presence_penalty, frequency_penalty fixed at 0

Testing

  • ✅ All existing tests pass
  • ✅ New TestGPT5ModelsChatCompletionsBetaLimitations validates parameter restrictions
  • ✅ Updated TestCompletionWithGPT5Models for completions endpoint restrictions

Copy link

codecov bot commented Aug 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.59%. Comparing base (c4273cb) to head (eb991b1).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1062   +/-   ##
=======================================
  Coverage   99.59%   99.59%           
=======================================
  Files          34       34           
  Lines        2205     2206    +1     
=======================================
+ Hits         2196     2197    +1     
  Misses          6        6           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sashabaranov sashabaranov requested a review from Copilot August 11, 2025 09:14
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 OpenAI's newly released GPT-5 model series by introducing model constants and extending the existing reasoning model validation framework to include GPT-5 models.

  • Added four new GPT-5 model constants (GPT5, GPT5Mini, GPT5Nano, GPT5ChatLatest)
  • Extended ReasoningValidator to apply parameter restrictions to GPT-5 models (same limitations as O1/O3/O4 series)
  • Updated completion endpoint restrictions to disable GPT-5 models from the completions API

Reviewed Changes

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

File Description
completion.go Adds GPT-5 model constants and disables them for completion endpoint
reasoning_validator.go Extends validation logic to include GPT-5 series models with parameter restrictions
completion_test.go Tests that GPT-5 models are properly rejected by completion endpoint
chat_test.go Comprehensive test coverage for GPT-5 model parameter restrictions in chat completions

Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

@sashabaranov sashabaranov merged commit f7d6ece into sashabaranov:master Aug 11, 2025
3 checks passed
Rosenberg96 pushed a commit to lunarway/go-openai that referenced this pull request Aug 18, 2025
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.

2 participants