Merge pull request #484 from alibaba/feat/gpt-54-models
feat(models): support gpt-5.4 and update model list
This commit is contained in:
@@ -53,6 +53,13 @@ export function modelPatch(body: Record<string, any>) {
|
|||||||
debug('Applying Claude patch: convert tool_choice format')
|
debug('Applying Claude patch: convert tool_choice format')
|
||||||
body.tool_choice = { type: 'tool', name: body.tool_choice.function.name }
|
body.tool_choice = { type: 'tool', name: body.tool_choice.function.name }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Claude naming pattern has changed
|
||||||
|
// needs proper handling
|
||||||
|
if (modelName.startsWith('claude-opus-4-7') || modelName.startsWith('claude-opus-47')) {
|
||||||
|
debug('Applying Claude-4.7 patch: remove temperature')
|
||||||
|
delete body.temperature
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modelName.startsWith('grok')) {
|
if (modelName.startsWith('grok')) {
|
||||||
@@ -74,10 +81,12 @@ export function modelPatch(body: Record<string, any>) {
|
|||||||
debug('Applying GPT-51 patch: disable reasoning')
|
debug('Applying GPT-51 patch: disable reasoning')
|
||||||
body.reasoning_effort = 'none'
|
body.reasoning_effort = 'none'
|
||||||
} else if (modelName.startsWith('gpt-54')) {
|
} else if (modelName.startsWith('gpt-54')) {
|
||||||
debug(
|
debug('Applying GPT-5.4 patch: remove reasoning_effort')
|
||||||
'Applying GPT-5.4 patch: skip reasoning_effort because chat/completions rejects it with function tools'
|
|
||||||
)
|
|
||||||
delete body.reasoning_effort
|
delete body.reasoning_effort
|
||||||
|
} else if (modelName.startsWith('gpt-55')) {
|
||||||
|
debug('Applying GPT-5.4 patch: remove reasoning_effort and temperature')
|
||||||
|
delete body.reasoning_effort
|
||||||
|
delete body.temperature
|
||||||
} else if (modelName.startsWith('gpt-5-mini')) {
|
} else if (modelName.startsWith('gpt-5-mini')) {
|
||||||
debug('Applying GPT-5-mini patch: set reasoning effort to low, temperature to 1')
|
debug('Applying GPT-5-mini patch: set reasoning effort to low, temperature to 1')
|
||||||
body.reasoning_effort = 'low'
|
body.reasoning_effort = 'low'
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import { useLanguage } from '@/i18n/context'
|
|||||||
|
|
||||||
const BASELINE = new Set([
|
const BASELINE = new Set([
|
||||||
'gpt-5.1',
|
'gpt-5.1',
|
||||||
|
'gpt-5.4-mini',
|
||||||
'claude-haiku-4.5',
|
'claude-haiku-4.5',
|
||||||
'gemini-3-flash',
|
'gemini-3.1-flash-lite',
|
||||||
'deepseek-v4-flash',
|
'deepseek-v4-flash',
|
||||||
'qwen3.5-plus',
|
'qwen3.5-plus',
|
||||||
'qwen3.5-flash',
|
'qwen3.5-flash',
|
||||||
@@ -26,10 +27,22 @@ const MODEL_GROUPS: Record<string, string[]> = {
|
|||||||
'qwen-3-max',
|
'qwen-3-max',
|
||||||
'qwen-3-plus',
|
'qwen-3-plus',
|
||||||
],
|
],
|
||||||
OpenAI: ['gpt-5.4', 'gpt-5.2', 'gpt-5.1', 'gpt-5', 'gpt-5-mini', 'gpt-4.1', 'gpt-4.1-mini'],
|
OpenAI: [
|
||||||
|
'gpt-5.5',
|
||||||
|
'gpt-5.4',
|
||||||
|
'gpt-5.4-mini',
|
||||||
|
'gpt-5.4-nano',
|
||||||
|
'gpt-5.2',
|
||||||
|
'gpt-5.1',
|
||||||
|
'gpt-5',
|
||||||
|
'gpt-5-mini',
|
||||||
|
'gpt-4.1',
|
||||||
|
'gpt-4.1-mini',
|
||||||
|
],
|
||||||
DeepSeek: ['deepseek-v4-pro', 'deepseek-v4-flash', 'deepseek-3.2'],
|
DeepSeek: ['deepseek-v4-pro', 'deepseek-v4-flash', 'deepseek-3.2'],
|
||||||
Google: ['gemini-3-pro', 'gemini-3-flash', 'gemini-2.5'],
|
Google: ['gemini-3.1-flash-lite', 'gemini-3-pro', 'gemini-3-flash', 'gemini-2.5'],
|
||||||
Anthropic: [
|
Anthropic: [
|
||||||
|
'claude-opus-4.7',
|
||||||
'claude-opus-4.6',
|
'claude-opus-4.6',
|
||||||
'claude-opus-4.5',
|
'claude-opus-4.5',
|
||||||
'claude-sonnet-4.5',
|
'claude-sonnet-4.5',
|
||||||
|
|||||||
Reference in New Issue
Block a user