-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: gpt-5 support #7054
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
feat: gpt-5 support #7054
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -75,6 +75,15 @@ export const OpenAi: ModelProvider = { | |||||
| contextLength: 128000, | ||||||
| maxCompletionTokens: 4096, | ||||||
| }, | ||||||
| // gpt-5 | ||||||
| { | ||||||
| model: "gpt-5", | ||||||
| displayName: "GPT-5", | ||||||
| contextLength: 400000, | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are multiple, conflicting sources of truth for model configuration. The context length for 'gpt-5' is defined as 400,000 here, but it is set to 128,000 in Prompt for AI agents |
||||||
| maxCompletionTokens: 128000, | ||||||
| regex: /gpt-5/, | ||||||
| recommendedFor: ["chat"], | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Prompt for AI agents
Suggested change
|
||||||
| }, | ||||||
| // gpt-4o | ||||||
| { | ||||||
| model: "gpt-4o", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for adapting requests for specific OpenAI models (O-series and GPT-5) is duplicated in multiple locations. This same logic exists in
packages/openai-adapters/src/apis/OpenAI.ts. This violates the DRY (Don't Repeat Yourself) principle and creates a maintenance burden. If the adaptation requirements change or a new model needs similar handling, the changes must be manually synchronized across different packages. This logic should be centralized into a single adapter or middleware that handles all outgoing requests to the OpenAI API, ensuring that model-specific quirks are handled consistently.Prompt for AI agents