Skip to content

Comments

feat: enable gpt-5 model#29

Open
KojoBarbie wants to merge 1 commit intoYuvDwi:mainfrom
KojoBarbie:feature/enable-gpt-5-model
Open

feat: enable gpt-5 model#29
KojoBarbie wants to merge 1 commit intoYuvDwi:mainfrom
KojoBarbie:feature/enable-gpt-5-model

Conversation

@KojoBarbie
Copy link

OpenAI API: gpt-5-mini Support

Overview

This PR adds support for gpt-5-mini and newer gpt-5 models in the OpenAI API client. The changes address API parameter specification differences in the newer models.

Changes

1. API Parameter Changes

  • Changed max_tokensmax_completion_tokens
    • Newer gpt-5 models require max_completion_tokens instead of max_tokens

2. Default Value Updates

  • Default model: gpt-4-turbo-previewgpt-5-mini
  • Default temperature: 0.71.0
    • gpt-5 and newer models only support temperature value of 1

3. Configuration Comments Update

  • Updated model selection comments
  • Added note about gpt-5+ temperature restrictions

Modified Files

  • src/main/java/com/steve/ai/ai/OpenAIClient.java
    • Changed to use max_completion_tokens parameter
  • src/main/java/com/steve/ai/config/SteveConfig.java
    • Changed default model to gpt-5-mini
    • Changed default temperature to 1.0
    • Updated comments

Testing

  • Verified API requests work correctly with gpt-5-mini model
  • Confirmed error responses (unsupported_parameter, unsupported_value) are resolved

Compatibility

  • Older models (gpt-3.5-turbo, gpt-4, etc.) will still work, but will use max_completion_tokens parameter
  • You can still use older models by changing the model name or temperature value in the config file

Related Errors

The following errors are resolved:

  • Unsupported parameter: 'max_tokens' is not supported with this model
  • Unsupported value: 'temperature' does not support 0.7 with this model

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