Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0446127

Browse files
authored
💄 style: Update GPT-5.2 models (#10749)
* ✨ feat: 添加 GPT-5.2 和 GPT-5.2 Pro 模型及其推理努力滑块 * ✨ feat: 添加 GPT-5.2 和 GPT-5.2 Pro 模型,更新 GPT-5.2 推理努力滑块的标签 * 🔨 chore: 移除 GPT-5.2 和 GPT-5.2 Pro 模型的推理努力参数及相关组件 * ✨ feat: 更新模型设置,添加 gpt5_1ReasoningEffort 参数
1 parent 79b2afd commit 0446127

File tree

6 files changed

+241
-9
lines changed

6 files changed

+241
-9
lines changed

packages/model-bank/src/aiModels/aihubmix.ts

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,80 @@
11
import { AIChatModelCard } from '../types/aiModel';
22

33
const aihubmixModels: AIChatModelCard[] = [
4+
{
5+
abilities: {
6+
functionCall: true,
7+
reasoning: true,
8+
search: true,
9+
structuredOutput: true,
10+
vision: true,
11+
},
12+
contextWindowTokens: 400_000,
13+
description: 'GPT-5.2 — 面向编码与 agentic 工作流的旗舰模型,提供更强推理与长上下文能力。',
14+
displayName: 'GPT-5.2',
15+
enabled: true,
16+
id: 'gpt-5.2',
17+
maxOutput: 128_000,
18+
pricing: {
19+
units: [
20+
{ name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
21+
{ name: 'textInput_cacheRead', rate: 0.175, strategy: 'fixed', unit: 'millionTokens' },
22+
{ name: 'textOutput', rate: 14, strategy: 'fixed', unit: 'millionTokens' },
23+
],
24+
},
25+
releasedAt: '2025-12-11',
26+
settings: {
27+
extendParams: ['gpt5_1ReasoningEffort', 'textVerbosity'],
28+
searchImpl: 'params',
29+
},
30+
type: 'chat',
31+
},
32+
{
33+
abilities: {
34+
functionCall: true,
35+
reasoning: true,
36+
search: true,
37+
vision: true,
38+
},
39+
contextWindowTokens: 400_000,
40+
description:
41+
'GPT-5.2 pro:更聪明、更精确的 GPT-5.2 版本(Responses API Only),适合高难度问题与更长的多轮推理。',
42+
displayName: 'GPT-5.2 pro',
43+
id: 'gpt-5.2-pro',
44+
maxOutput: 128_000,
45+
pricing: {
46+
units: [
47+
{ name: 'textInput', rate: 21, strategy: 'fixed', unit: 'millionTokens' },
48+
{ name: 'textOutput', rate: 168, strategy: 'fixed', unit: 'millionTokens' },
49+
],
50+
},
51+
releasedAt: '2025-12-11',
52+
settings: {
53+
searchImpl: 'params',
54+
},
55+
type: 'chat',
56+
},
57+
{
58+
abilities: {
59+
functionCall: true,
60+
vision: true,
61+
},
62+
contextWindowTokens: 128_000,
63+
description: 'GPT-5.2 Chat:ChatGPT 使用的 GPT-5.2 变体(chat-latest),用于体验最新对话改进。',
64+
displayName: 'GPT-5.2 Chat',
65+
enabled: true,
66+
id: 'gpt-5.2-chat-latest',
67+
maxOutput: 16_384,
68+
pricing: {
69+
units: [
70+
{ name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
71+
{ name: 'textInput_cacheRead', rate: 0.175, strategy: 'fixed', unit: 'millionTokens' },
72+
{ name: 'textOutput', rate: 14, strategy: 'fixed', unit: 'millionTokens' },
73+
],
74+
},
75+
releasedAt: '2025-12-11',
76+
type: 'chat',
77+
},
478
{
579
abilities: {
680
functionCall: true,
@@ -13,7 +87,6 @@ const aihubmixModels: AIChatModelCard[] = [
1387
description:
1488
'GPT-5.1 — 针对编码和 agent 任务优化的旗舰模型,支持可配置的推理强度与更长上下文。',
1589
displayName: 'GPT-5.1',
16-
enabled: true,
1790
id: 'gpt-5.1',
1891
maxOutput: 128_000,
1992
pricing: {
@@ -38,7 +111,6 @@ const aihubmixModels: AIChatModelCard[] = [
38111
contextWindowTokens: 128_000,
39112
description: 'GPT-5.1 Chat:用于 ChatGPT 的 GPT-5.1 变体,适合聊天场景。',
40113
displayName: 'GPT-5.1 Chat',
41-
enabled: true,
42114
id: 'gpt-5.1-chat-latest',
43115
maxOutput: 16_384,
44116
pricing: {

packages/model-bank/src/aiModels/ollamacloud.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { AIChatModelCard } from '../types/aiModel';
22

33
const ollamaCloudModels: AIChatModelCard[] = [
4+
{
5+
abilities: {
6+
functionCall: true,
7+
},
8+
contextWindowTokens: 262_144,
9+
description:
10+
'Devstral 2 123B 模型,擅长使用工具探索代码库、编辑多个文件并为软件工程代理提供支持。',
11+
displayName: 'Devstral 2',
12+
id: 'devstral-2:123b',
13+
type: 'chat',
14+
},
415
{
516
abilities: {
617
functionCall: true,

packages/model-bank/src/aiModels/openai.ts

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,80 @@ export const openaiChatModels: AIChatModelCard[] = [
2121
{
2222
abilities: {
2323
functionCall: true,
24-
imageOutput: true,
24+
reasoning: true,
25+
search: true,
26+
structuredOutput: true,
27+
vision: true,
28+
},
29+
contextWindowTokens: 400_000,
30+
description: 'GPT-5.2 — 面向编码与 agentic 工作流的旗舰模型,提供更强推理与长上下文能力。',
31+
displayName: 'GPT-5.2',
32+
enabled: true,
33+
id: 'gpt-5.2',
34+
maxOutput: 128_000,
35+
pricing: {
36+
units: [
37+
{ name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
38+
{ name: 'textInput_cacheRead', rate: 0.175, strategy: 'fixed', unit: 'millionTokens' },
39+
{ name: 'textOutput', rate: 14, strategy: 'fixed', unit: 'millionTokens' },
40+
],
41+
},
42+
releasedAt: '2025-12-11',
43+
settings: {
44+
extendParams: ['gpt5_1ReasoningEffort', 'textVerbosity'],
45+
searchImpl: 'params',
46+
},
47+
type: 'chat',
48+
},
49+
{
50+
abilities: {
51+
functionCall: true,
52+
reasoning: true,
53+
search: true,
54+
vision: true,
55+
},
56+
contextWindowTokens: 400_000,
57+
description:
58+
'GPT-5.2 pro:更聪明、更精确的 GPT-5.2 版本(Responses API Only),适合高难度问题与更长的多轮推理。',
59+
displayName: 'GPT-5.2 pro',
60+
id: 'gpt-5.2-pro',
61+
maxOutput: 128_000,
62+
pricing: {
63+
units: [
64+
{ name: 'textInput', rate: 21, strategy: 'fixed', unit: 'millionTokens' },
65+
{ name: 'textOutput', rate: 168, strategy: 'fixed', unit: 'millionTokens' },
66+
],
67+
},
68+
releasedAt: '2025-12-11',
69+
settings: {
70+
searchImpl: 'params',
71+
},
72+
type: 'chat',
73+
},
74+
{
75+
abilities: {
76+
functionCall: true,
77+
vision: true,
78+
},
79+
contextWindowTokens: 128_000,
80+
description: 'GPT-5.2 Chat:ChatGPT 使用的 GPT-5.2 变体(chat-latest),用于体验最新对话改进。',
81+
displayName: 'GPT-5.2 Chat',
82+
enabled: true,
83+
id: 'gpt-5.2-chat-latest',
84+
maxOutput: 16_384,
85+
pricing: {
86+
units: [
87+
{ name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
88+
{ name: 'textInput_cacheRead', rate: 0.175, strategy: 'fixed', unit: 'millionTokens' },
89+
{ name: 'textOutput', rate: 14, strategy: 'fixed', unit: 'millionTokens' },
90+
],
91+
},
92+
releasedAt: '2025-12-11',
93+
type: 'chat',
94+
},
95+
{
96+
abilities: {
97+
functionCall: true,
2598
reasoning: true,
2699
search: true,
27100
vision: true,
@@ -30,7 +103,6 @@ export const openaiChatModels: AIChatModelCard[] = [
30103
description:
31104
'GPT-5.1 — 针对编码和 agent 任务优化的旗舰模型,支持可配置的推理强度与更长上下文。',
32105
displayName: 'GPT-5.1',
33-
enabled: true,
34106
id: 'gpt-5.1',
35107
maxOutput: 128_000,
36108
pricing: {
@@ -55,7 +127,6 @@ export const openaiChatModels: AIChatModelCard[] = [
55127
contextWindowTokens: 128_000,
56128
description: 'GPT-5.1 Chat:用于 ChatGPT 的 GPT-5.1 变体,适合聊天场景。',
57129
displayName: 'GPT-5.1 Chat',
58-
enabled: true,
59130
id: 'gpt-5.1-chat-latest',
60131
maxOutput: 16_384,
61132
pricing: {
@@ -71,7 +142,6 @@ export const openaiChatModels: AIChatModelCard[] = [
71142
{
72143
abilities: {
73144
functionCall: true,
74-
imageOutput: true,
75145
reasoning: true,
76146
search: true,
77147
vision: true,
@@ -99,7 +169,6 @@ export const openaiChatModels: AIChatModelCard[] = [
99169
{
100170
abilities: {
101171
functionCall: true,
102-
imageOutput: true,
103172
reasoning: true,
104173
search: true,
105174
vision: true,

packages/model-bank/src/aiModels/zenmux.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,80 @@ const zenmuxChatModels: AIChatModelCard[] = [
88
id: 'zenmux/auto',
99
type: 'chat',
1010
},
11+
{
12+
abilities: {
13+
functionCall: true,
14+
reasoning: true,
15+
search: true,
16+
structuredOutput: true,
17+
vision: true,
18+
},
19+
contextWindowTokens: 400_000,
20+
description: 'GPT-5.2 — 面向编码与 agentic 工作流的旗舰模型,提供更强推理与长上下文能力。',
21+
displayName: 'GPT-5.2',
22+
enabled: true,
23+
id: 'gpt-5.2',
24+
maxOutput: 128_000,
25+
pricing: {
26+
units: [
27+
{ name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
28+
{ name: 'textInput_cacheRead', rate: 0.175, strategy: 'fixed', unit: 'millionTokens' },
29+
{ name: 'textOutput', rate: 14, strategy: 'fixed', unit: 'millionTokens' },
30+
],
31+
},
32+
releasedAt: '2025-12-11',
33+
settings: {
34+
extendParams: ['gpt5_1ReasoningEffort', 'textVerbosity'],
35+
searchImpl: 'params',
36+
},
37+
type: 'chat',
38+
},
39+
{
40+
abilities: {
41+
functionCall: true,
42+
reasoning: true,
43+
search: true,
44+
vision: true,
45+
},
46+
contextWindowTokens: 400_000,
47+
description:
48+
'GPT-5.2 pro:更聪明、更精确的 GPT-5.2 版本(Responses API Only),适合高难度问题与更长的多轮推理。',
49+
displayName: 'GPT-5.2 pro',
50+
id: 'gpt-5.2-pro',
51+
maxOutput: 128_000,
52+
pricing: {
53+
units: [
54+
{ name: 'textInput', rate: 21, strategy: 'fixed', unit: 'millionTokens' },
55+
{ name: 'textOutput', rate: 168, strategy: 'fixed', unit: 'millionTokens' },
56+
],
57+
},
58+
releasedAt: '2025-12-11',
59+
settings: {
60+
searchImpl: 'params',
61+
},
62+
type: 'chat',
63+
},
64+
{
65+
abilities: {
66+
functionCall: true,
67+
vision: true,
68+
},
69+
contextWindowTokens: 128_000,
70+
description: 'GPT-5.2 Chat:ChatGPT 使用的 GPT-5.2 变体(chat-latest),用于体验最新对话改进。',
71+
displayName: 'GPT-5.2 Chat',
72+
enabled: true,
73+
id: 'gpt-5.2-chat-latest',
74+
maxOutput: 16_384,
75+
pricing: {
76+
units: [
77+
{ name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
78+
{ name: 'textInput_cacheRead', rate: 0.175, strategy: 'fixed', unit: 'millionTokens' },
79+
{ name: 'textOutput', rate: 14, strategy: 'fixed', unit: 'millionTokens' },
80+
],
81+
},
82+
releasedAt: '2025-12-11',
83+
type: 'chat',
84+
},
1185
{
1286
abilities: {
1387
functionCall: true,

packages/model-runtime/src/const/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export const responsesAPIModels = new Set([
4040
'gpt-5-pro-2025-10-06',
4141
'gpt-5.1-codex',
4242
'gpt-5.1-codex-mini',
43+
'gpt-5.2-pro-2025-12-11',
44+
'gpt-5.2-pro',
4345
]);
4446

4547
/**

packages/model-runtime/src/core/contextBuilders/openai.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ export const pruneReasoningPayload = (payload: ChatStreamPayload) => {
136136
const shouldStream = !disableStreamModels.has(payload.model);
137137
const { stream_options, ...cleanedPayload } = payload as any;
138138

139+
// When reasoning_effort is 'none', allow user-defined temperature/top_p
140+
const effort = payload.reasoning?.effort || payload.reasoning_effort;
141+
const isEffortNone = effort === 'none';
142+
139143
return {
140144
...cleanedPayload,
141145
frequency_penalty: 0,
@@ -152,8 +156,8 @@ export const pruneReasoningPayload = (payload: ChatStreamPayload) => {
152156
stream: shouldStream,
153157
// Only include stream_options when stream is enabled
154158
...(shouldStream && stream_options && { stream_options }),
155-
temperature: 1,
156-
top_p: 1,
159+
temperature: isEffortNone ? payload.temperature : 1,
160+
top_p: isEffortNone ? payload.top_p : 1,
157161
};
158162
};
159163

0 commit comments

Comments
 (0)