-
Notifications
You must be signed in to change notification settings - Fork 625
feat: add GPT-5 series model support #717
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
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,13 +13,70 @@ export interface ProviderModelSetting { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| functionCall?: boolean // 是否支持函数调用 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoning?: boolean // 是否支持推理能力 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type?: ModelType // 模型类型,默认为Chat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // GPT-5 系列新参数 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verbosity?: 'low' | 'medium' | 'high' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxCompletionTokens?: number // GPT-5 系列使用此参数替代 maxTokens | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+19
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. Make maxTokens optional in schema to align with GPT‑5 (no max_tokens). Keeping Proposed interface tweak (outside the selected lines) to unblock GPT‑5 objects omitting maxTokens: export interface ProviderModelSetting {
id: string
name: string
match: string[]
maxTokens?: number // now optional; GPT‑5 uses maxCompletionTokens
contextLength: number
temperature?: number
vision?: boolean
functionCall?: boolean
reasoning?: boolean
type?: ModelType
// GPT‑5 series parameters
reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high'
verbosity?: 'low' | 'medium' | 'high'
maxCompletionTokens?: number
}Also ensure 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 为每个提供商创建映射对象,使用models数组包装模型配置 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const providerModelSettings: Record<string, { models: ProviderModelSetting[] }> = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // OpenAI提供商特定模型配置 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openai: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| models: [] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| models: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: 'gpt-5-chat', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'GPT-5 Chat', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxTokens: 16384, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextLength: 272000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| match: ['gpt-5-chat', 'gpt-5-chat-latest'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vision: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| functionCall: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoning: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoningEffort: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verbosity: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxCompletionTokens: 16384 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: 'gpt-5-mini', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'GPT-5 Mini', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxTokens: 128000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextLength: 272000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| match: ['gpt-5-mini', 'gpt-5-mini-2025-08-07'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vision: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| functionCall: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoning: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoningEffort: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verbosity: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxCompletionTokens: 128000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: 'gpt-5-nano', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'GPT-5 Nano', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxTokens: 128000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextLength: 272000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| match: ['gpt-5-nano', 'gpt-5-nano-2025-08-07'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vision: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| functionCall: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoning: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoningEffort: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verbosity: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxCompletionTokens: 128000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: 'gpt-5', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'GPT-5', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxTokens: 128000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextLength: 272000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| match: ['gpt-5', 'gpt-5-2025-08-07'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vision: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| functionCall: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoning: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoningEffort: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verbosity: 'medium', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxCompletionTokens: 128000 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+79
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. 🛠️ Refactor suggestion Avoid setting maxTokens for GPT‑5 models; rely on maxCompletionTokens. To prevent accidental use of {
id: 'gpt-5-chat',
name: 'GPT-5 Chat',
- maxTokens: 16384,
contextLength: 272000,
match: ['gpt-5-chat', 'gpt-5-chat-latest'],
vision: true,
functionCall: false,
reasoning: true,
reasoningEffort: 'medium',
verbosity: 'medium',
maxCompletionTokens: 16384
},
{
id: 'gpt-5-mini',
name: 'GPT-5 Mini',
- maxTokens: 128000,
contextLength: 272000,
match: ['gpt-5-mini', 'gpt-5-mini-2025-08-07'],
vision: true,
functionCall: true,
reasoning: true,
reasoningEffort: 'medium',
verbosity: 'medium',
maxCompletionTokens: 128000
},
{
id: 'gpt-5-nano',
name: 'GPT-5 Nano',
- maxTokens: 128000,
contextLength: 272000,
match: ['gpt-5-nano', 'gpt-5-nano-2025-08-07'],
vision: true,
functionCall: true,
reasoning: true,
reasoningEffort: 'medium',
verbosity: 'medium',
maxCompletionTokens: 128000
},
{
id: 'gpt-5',
name: 'GPT-5',
- maxTokens: 128000,
contextLength: 272000,
match: ['gpt-5', 'gpt-5-2025-08-07'],
vision: true,
functionCall: true,
reasoning: true,
reasoningEffort: 'medium',
verbosity: 'medium',
maxCompletionTokens: 128000
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 火山引擎(Doubao)提供商特定模型配置 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2390,11 +2447,14 @@ export function getProviderSpecificModelConfig( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxTokens: config.maxTokens, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextLength: config.contextLength, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| temperature: config.temperature || 0.7, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| temperature: config.temperature, // 保持可选,某些模型不支持 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vision: config.vision || false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| functionCall: config.functionCall || false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoning: config.reasoning || false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: config.type || ModelType.Chat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: config.type || ModelType.Chat, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reasoningEffort: config.reasoningEffort, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| verbosity: config.verbosity, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxCompletionTokens: config.maxCompletionTokens | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+2450
to
2458
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. 💡 Verification agent 🧩 Analysis chainGuard against sending temperature for GPT‑5 and prefer maxCompletionTokens. Even if upstream accidentally provides a temperature, GPT‑5 must not receive it. Also, ensure downstream logic prioritizes - temperature: config.temperature, // 保持可选,某些模型不支持
+ // GPT‑5 does not support temperature; drop it for GPT‑5 models
+ temperature: lowerModelId.includes('gpt-5') ? undefined : config.temperature,
vision: config.vision || false,
functionCall: config.functionCall || false,
reasoning: config.reasoning || false,
type: config.type || ModelType.Chat,
reasoningEffort: config.reasoningEffort,
verbosity: config.verbosity,
maxCompletionTokens: config.maxCompletionTokensRun the script below to confirm no code path still defaults/forces temperature for GPT‑5 and that providers send 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Search places that default temperature:"
rg -n --pretty "(default.*temperature|temperature\s*=\s*0\.7|temperature:\s*0\.7)"
echo
echo "Search GPT-5 handling in providers (ensure no temperature in payload):"
rg -n --pretty "gpt-5|gpt5|gpt_5" src | sed -n '1,200p'
echo
echo "Search payload keys used for token limits:"
rg -n --pretty "max_completion_tokens|maxCompletionTokens|max_tokens|maxTokens"
echo
echo "OpenAI provider request construction around token params:"
rg -n -A5 -B5 --pretty "max_completion_tokens|max_tokens" src/main/presenter/llmProviderPresenterLength of output: 54394 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Extract OPENAI_REASONING_MODELS constant"
rg -n --pretty "OPENAI_REASONING_MODELS" -A5 src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.tsLength of output: 892 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Snippet around line 1580 in threadPresenter:"
sed -n '1550,1620p' src/main/presenter/threadPresenter/index.ts
echo
echo "Snippet around line 1640 in threadPresenter:"
sed -n '1620,1700p' src/main/presenter/threadPresenter/index.tsLength of output: 5336 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "===== Top of providerModelSettings.ts ====="
sed -n '1,200p' src/main/presenter/configPresenter/providerModelSettings.ts
echo
echo "===== Mapping function around lines 2300–2500 ====="
sed -n '2300,2500p' src/main/presenter/configPresenter/providerModelSettings.tsLength of output: 10143 Drop The helper in Locations to update: Suggested diff: --- a/src/main/presenter/configPresenter/providerModelSettings.ts
+++ b/src/main/presenter/configPresenter/providerModelSettings.ts
@@ export function getProviderSpecificModelConfig(
- temperature: config.temperature, // 保持可选,某些模型不支持
+ // GPT-5 does not accept a temperature parameter—always drop it
+ temperature: lowerModelId.includes('gpt-5') ? undefined : config.temperature,
vision: config.vision || false,
functionCall: config.functionCall || false,
reasoning: config.reasoning || false,
type: config.type || ModelType.Chat,
reasoningEffort: config.reasoningEffort,
verbosity: config.verbosity,
maxCompletionTokens: config.maxCompletionTokensThis change ensures GPT-5 models never carry a 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,11 @@ const OPENAI_REASONING_MODELS = [ | |
| 'o1-mini', | ||
| 'o1-pro', | ||
| 'o1-preview', | ||
| 'o1' | ||
| 'o1', | ||
| 'gpt-5', | ||
| 'gpt-5-mini', | ||
| 'gpt-5-nano', | ||
| 'gpt-5-chat' | ||
| ] | ||
| const OPENAI_IMAGE_GENERATION_MODELS = [ | ||
| 'gpt-4o-all', | ||
|
|
@@ -210,7 +214,10 @@ export class OpenAICompatibleProvider extends BaseLLMProvider { | |
| model: modelId, | ||
| stream: false, | ||
| temperature: temperature, | ||
| ...(modelId.startsWith('o1') || modelId.startsWith('o3') || modelId.startsWith('o4') | ||
| ...(modelId.startsWith('o1') || | ||
| modelId.startsWith('o3') || | ||
| modelId.startsWith('o4') || | ||
| modelId.startsWith('gpt-5') | ||
| ? { max_completion_tokens: maxTokens } | ||
| : { max_tokens: maxTokens }) | ||
| } | ||
|
Comment on lines
+217
to
223
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. 🛠️ Refactor suggestion DRY up token-limit parameter branching The Extracting into a helper prevents drift: function getTokenParam(modelId: string, tokens: number) {
return modelId.startsWith('o1') ||
modelId.startsWith('o3') ||
modelId.startsWith('o4') ||
modelId.startsWith('gpt-5')
? { max_completion_tokens: tokens }
: { max_tokens: tokens };
}Then: - ...,
- ...(modelId.startsWith('o1') || ... ? { ... } : { ... })
+ ...,
+ ...getTokenParam(modelId, maxTokens)🤖 Prompt for AI Agents |
||
|
|
@@ -528,7 +535,10 @@ export class OpenAICompatibleProvider extends BaseLLMProvider { | |
| model: modelId, | ||
| stream: true, | ||
| temperature, | ||
| ...(modelId.startsWith('o1') || modelId.startsWith('o3') || modelId.startsWith('o4') | ||
| ...(modelId.startsWith('o1') || | ||
| modelId.startsWith('o3') || | ||
| modelId.startsWith('o4') || | ||
| modelId.startsWith('gpt-5') | ||
| ? { max_completion_tokens: maxTokens } | ||
| : { max_tokens: maxTokens }) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,11 @@ const showThinkingBudget = computed(() => { | |
| return isGemini && isGemini25 | ||
| }) | ||
|
|
||
| const isGPT5Model = computed(() => { | ||
| const modelId = props.modelId?.toLowerCase() || '' | ||
| return modelId.startsWith('gpt-5') | ||
| }) | ||
|
|
||
| // 当前显示的思考预算值 | ||
| const displayThinkingBudget = computed({ | ||
| get: () => { | ||
|
|
@@ -126,8 +131,8 @@ const handleDynamicThinkingToggle = (enabled: boolean) => { | |
| /> | ||
| </div> | ||
|
|
||
| <!-- Temperature --> | ||
| <div class="space-y-4 px-2"> | ||
| <!-- Temperature (GPT-5 系列模型不显示) --> | ||
| <div v-if="!isGPT5Model" class="space-y-4 px-2"> | ||
| <div class="flex items-center justify-between"> | ||
|
Comment on lines
+134
to
136
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. UI hides temperature but component still emits it The slider is hidden for GPT-5, yet
Otherwise requests will still carry an unsupported 🤖 Prompt for AI Agents |
||
| <div class="flex items-center space-x-2"> | ||
| <Icon icon="lucide:thermometer" class="w-4 h-4 text-muted-foreground" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,8 @@ | |
| v-model:artifacts="artifacts" | ||
| :context-length-limit="contextLengthLimit" | ||
| :max-tokens-limit="maxTokensLimit" | ||
| :model-id="activeModel?.id" | ||
| :provider-id="activeModel?.providerId" | ||
| /> | ||
|
Comment on lines
+90
to
92
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. Passing model identity 👍 — but remember to drop GPT-5-only banned params
- const threadId = await chatStore.createThread(content.text, {
- providerId: activeModel.value.providerId,
- modelId: activeModel.value.id,
- systemPrompt: systemPrompt.value,
- temperature: temperature.value,
- contextLength: contextLength.value,
- maxTokens: maxTokens.value,
+ const isGPT5 = activeModel.value.id?.toLowerCase().startsWith('gpt-5')
+ const threadId = await chatStore.createThread(content.text, {
+ providerId: activeModel.value.providerId,
+ modelId: activeModel.value.id,
+ systemPrompt: systemPrompt.value,
+ ...(isGPT5 ? {} : { temperature: temperature.value }),
+ contextLength: contextLength.value,
+ ...(isGPT5
+ ? { maxCompletionTokens: maxTokens.value }
+ : { maxTokens: maxTokens.value }),Failing to do this will cause GPT-5 calls to 400/422.
🤖 Prompt for AI Agents |
||
| </PopoverContent> | ||
| </Popover> | ||
|
|
@@ -163,7 +165,7 @@ watch( | |
| activeModel.value.id, | ||
| activeModel.value.providerId | ||
| ) | ||
| temperature.value = config.temperature | ||
| temperature.value = config.temperature ?? 0.7 | ||
|
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. 🛠️ Refactor suggestion Defaulting temperature for GPT-5 defeats its removal
if (config.temperature !== undefined) {
temperature.value = config.temperature
} else if (!activeModel.value.id.startsWith('gpt-5')) {
temperature.value = 0.7
}This prevents accidentally re-adding 🤖 Prompt for AI Agents |
||
| contextLength.value = config.contextLength | ||
| maxTokens.value = config.maxTokens | ||
| contextLengthLimit.value = config.contextLength | ||
|
|
||
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.
💡 Verification agent
🧩 Analysis chain
Remove maxTokens for GPT‑5 defaults; keep only maxCompletionTokens.
To fully honor “replace max_tokens with max_completion_tokens” for GPT‑5, don’t set
maxTokenshere. This avoids UI/provider ambiguity. (MakemaxTokensoptional inDefaultModelSettingaccordingly.){ id: 'gpt-5-chat', name: 'GPT-5 Chat', - maxTokens: 16384, contextLength: 272000, match: ['gpt-5-chat', 'gpt-5-chat-latest'], vision: true, functionCall: false, reasoning: true, reasoningEffort: 'medium', verbosity: 'medium', maxCompletionTokens: 16384 }, { id: 'gpt-5-mini', name: 'GPT-5 Mini', - maxTokens: 128000, contextLength: 272000, match: ['gpt-5-mini', 'gpt-5-mini-2025-08-07'], vision: true, functionCall: true, reasoning: true, reasoningEffort: 'medium', verbosity: 'medium', maxCompletionTokens: 128000 }, { id: 'gpt-5-nano', name: 'GPT-5 Nano', - maxTokens: 128000, contextLength: 272000, match: ['gpt-5-nano', 'gpt-5-nano-2025-08-07'], vision: true, functionCall: true, reasoning: true, reasoningEffort: 'medium', verbosity: 'medium', maxCompletionTokens: 128000 }, { id: 'gpt-5', name: 'GPT-5', - maxTokens: 128000, contextLength: 272000, match: ['gpt-5', 'gpt-5-2025-08-07'], vision: true, functionCall: true, reasoning: true, reasoningEffort: 'medium', verbosity: 'medium', maxCompletionTokens: 128000 },Please also verify that the shared types support
maxCompletionTokensand do not requiremaxTokensfor GPT‑5:🏁 Script executed:
Length of output: 19610
Enforce GPT-5 defaults: remove maxTokens, use only maxCompletionTokens
The current changes only adjust defaults in
modelDefaultSettings.ts, but the shared types and renderer haven’t been updated. Please address the following:• src/main/presenter/configPresenter/modelDefaultSettings.ts
Remove
maxTokensentries for all GPT-5 models, e.g.:{ id: 'gpt-5-chat', name: 'GPT-5 Chat', - maxTokens: 16384, contextLength: 272000, … maxCompletionTokens: 16384 },• src/shared/presenter.d.ts
Make
maxTokensoptional in bothModelConfigandDefaultModelSettingso GPT-5 can omit it:export interface ModelConfig { - maxTokens: number + maxTokens?: number temperature?: number maxCompletionTokens?: number // GPT-5 uses this instead of maxTokens } export interface DefaultModelSetting { temperature?: number - maxTokens: number + maxTokens?: number maxCompletionTokens?: number // GPT-5 uses this instead of maxTokens … }• Renderer updates (add maxCompletionTokens, hide temperature/maxTokens for GPT-5):
– stores/chat.ts: extend
CONVERSATION_SETTINGSto includemaxCompletionTokens, and in your initialization logic, pullconfig.maxCompletionTokensinstead ofconfig.maxTokensfor GPT-5.– components/ChatConfig.vue, NewThread.vue, TitleView.vue:
- Wrap the temperature and max-tokens controls in
v-if="!isGPT5Model"- Add a slider/input bound to
maxCompletionTokensshown only whenisGPT5Model– ModelConfigDialog.vue already hides temperature for GPT-5; mirror similar logic for max-tokens vs. max-completion-tokens.
After these changes, GPT-5 models will have a single, unambiguous completion-budget parameter across the app.
🤖 Prompt for AI Agents