Skip to content

Commit 6545ef8

Browse files
authored
💄 style: Fully support Gemini 3.0 model (#10292)
* feat: 添加 Gemini 3 Pro 模型并移除 Gemini 2.0 Flash 预览模型 * feat: 添加思考水平功能,更新相关模型和配置 * feat: 添加 Gemini 3 Pro 模型并移除旧版 Gemini 2.5 Flash 和 Flash-Lite 模型 * feat: 添加 Gemini 3 Pro 预览模型及其相关配置 * fix: 调整 ThinkingLevelSlider 组件的最小宽度为 130 * fix: 修正对 3.0 模型的思考级别判断条件
1 parent de60a67 commit 6545ef8

File tree

11 files changed

+175
-94
lines changed

11 files changed

+175
-94
lines changed

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

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,66 @@ const aihubmixModels: AIChatModelCard[] = [
986986
},
987987
type: 'chat',
988988
},
989+
{
990+
abilities: {
991+
functionCall: true,
992+
reasoning: true,
993+
search: true,
994+
video: true,
995+
vision: true,
996+
},
997+
contextWindowTokens: 1_048_576 + 65_536,
998+
description:
999+
'Gemini 3 Pro 是 Google 最智能的模型,具有 SOTA 推理和多模式理解,以及强大的代理和氛围编码功能。',
1000+
displayName: 'Gemini 3 Pro Preview',
1001+
enabled: true,
1002+
id: 'gemini-3-pro-preview',
1003+
maxOutput: 65_536,
1004+
pricing: {
1005+
units: [
1006+
{
1007+
name: 'textInput_cacheRead',
1008+
strategy: 'tiered',
1009+
tiers: [
1010+
{ rate: 0.2, upTo: 200_000 },
1011+
{ rate: 0.4, upTo: 'infinity' },
1012+
],
1013+
unit: 'millionTokens',
1014+
},
1015+
{
1016+
name: 'textInput',
1017+
strategy: 'tiered',
1018+
tiers: [
1019+
{ rate: 2, upTo: 200_000 },
1020+
{ rate: 4, upTo: 'infinity' },
1021+
],
1022+
unit: 'millionTokens',
1023+
},
1024+
{
1025+
name: 'textOutput',
1026+
strategy: 'tiered',
1027+
tiers: [
1028+
{ rate: 12, upTo: 200_000 },
1029+
{ rate: 18, upTo: 'infinity' },
1030+
],
1031+
unit: 'millionTokens',
1032+
},
1033+
{
1034+
lookup: { prices: { '1h': 4.5 }, pricingParams: ['ttl'] },
1035+
name: 'textInput_cacheWrite',
1036+
strategy: 'lookup',
1037+
unit: 'millionTokens',
1038+
},
1039+
],
1040+
},
1041+
releasedAt: '2025-11-18',
1042+
settings: {
1043+
extendParams: ['thinkingLevel', 'urlContext'],
1044+
searchImpl: 'params',
1045+
searchProvider: 'google',
1046+
},
1047+
type: 'chat',
1048+
},
9891049
{
9901050
abilities: {
9911051
functionCall: true,
@@ -998,7 +1058,6 @@ const aihubmixModels: AIChatModelCard[] = [
9981058
description:
9991059
'Gemini 2.5 Pro 是 Google 最先进的思维模型,能够对代码、数学和STEM领域的复杂问题进行推理,以及使用长上下文分析大型数据集、代码库和文档。',
10001060
displayName: 'Gemini 2.5 Pro',
1001-
enabled: true,
10021061
id: 'gemini-2.5-pro',
10031062
maxOutput: 65_536,
10041063
pricing: {

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

Lines changed: 21 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ const googleChatModels: AIChatModelCard[] = [
123123
},
124124
contextWindowTokens: 1_048_576 + 65_536,
125125
description:
126-
'Gemini 3.0 Pro Preview 是 Google 最先进的思维模型,能够对代码、数学和STEM领域的复杂问题进行推理,以及使用长上下文分析大型数据集、代码库和文档。',
127-
displayName: 'Gemini 3.0 Pro Preview',
126+
'Gemini 3 Pro 是 全球最佳的多模态理解模型,也是 Google 迄今为止最强大的智能体和氛围编程模型,提供更丰富的视觉效果和更深层次的交互性,所有这些都建立在最先进的推理能力基础之上。',
127+
displayName: 'Gemini 3 Pro Preview',
128128
enabled: true,
129129
id: 'gemini-3-pro-preview',
130130
maxOutput: 65_536,
@@ -134,34 +134,40 @@ const googleChatModels: AIChatModelCard[] = [
134134
name: 'textInput_cacheRead',
135135
strategy: 'tiered',
136136
tiers: [
137-
{ rate: 0.20, upTo: 200_000 },
138-
{ rate: 0.40, upTo: 'infinity' },
137+
{ rate: 0.2, upTo: 200_000 },
138+
{ rate: 0.4, upTo: 'infinity' },
139139
],
140140
unit: 'millionTokens',
141141
},
142142
{
143143
name: 'textInput',
144144
strategy: 'tiered',
145145
tiers: [
146-
{ rate: 2.0, upTo: 200_000 },
147-
{ rate: 4.0, upTo: 'infinity' },
146+
{ rate: 2, upTo: 200_000 },
147+
{ rate: 4, upTo: 'infinity' },
148148
],
149149
unit: 'millionTokens',
150150
},
151151
{
152152
name: 'textOutput',
153153
strategy: 'tiered',
154154
tiers: [
155-
{ rate: 12.0, upTo: 200_000 },
156-
{ rate: 18.0, upTo: 'infinity' },
155+
{ rate: 12, upTo: 200_000 },
156+
{ rate: 18, upTo: 'infinity' },
157157
],
158158
unit: 'millionTokens',
159159
},
160+
{
161+
lookup: { prices: { '1h': 4.5 }, pricingParams: ['ttl'] },
162+
name: 'textInput_cacheWrite',
163+
strategy: 'lookup',
164+
unit: 'millionTokens',
165+
},
160166
],
161167
},
162168
releasedAt: '2025-11-18',
163169
settings: {
164-
extendParams: ['thinkingBudget', 'urlContext'],
170+
extendParams: ['thinkingLevel', 'urlContext'],
165171
searchImpl: 'params',
166172
searchProvider: 'google',
167173
},
@@ -211,6 +217,12 @@ const googleChatModels: AIChatModelCard[] = [
211217
],
212218
unit: 'millionTokens',
213219
},
220+
{
221+
lookup: { prices: { '1h': 4.5 }, pricingParams: ['ttl'] },
222+
name: 'textInput_cacheWrite',
223+
strategy: 'lookup',
224+
unit: 'millionTokens',
225+
},
214226
],
215227
},
216228
releasedAt: '2025-06-17',
@@ -383,34 +395,6 @@ const googleChatModels: AIChatModelCard[] = [
383395
},
384396
type: 'chat',
385397
},
386-
{
387-
abilities: {
388-
functionCall: true,
389-
reasoning: true,
390-
search: true,
391-
video: true,
392-
vision: true,
393-
},
394-
contextWindowTokens: 1_048_576 + 65_536,
395-
description: 'Gemini 2.5 Flash Preview 是 Google 性价比最高的模型,提供全面的功能。',
396-
displayName: 'Gemini 2.5 Flash Preview 05-20',
397-
id: 'gemini-2.5-flash-preview-05-20',
398-
maxOutput: 65_536,
399-
pricing: {
400-
units: [
401-
{ name: 'textInput_cacheRead', rate: 0.0375, strategy: 'fixed', unit: 'millionTokens' },
402-
{ name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
403-
{ name: 'textOutput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
404-
],
405-
},
406-
releasedAt: '2025-05-20',
407-
settings: {
408-
extendParams: ['thinkingBudget', 'urlContext'],
409-
searchImpl: 'params',
410-
searchProvider: 'google',
411-
},
412-
type: 'chat',
413-
},
414398
{
415399
abilities: {
416400
imageOutput: true,
@@ -514,35 +498,6 @@ const googleChatModels: AIChatModelCard[] = [
514498
},
515499
type: 'chat',
516500
},
517-
{
518-
abilities: {
519-
functionCall: true,
520-
reasoning: true,
521-
search: true,
522-
video: true,
523-
vision: true,
524-
},
525-
contextWindowTokens: 1_048_576 + 65_536,
526-
description:
527-
'Gemini 2.5 Flash-Lite Preview 是 Google 最小、性价比最高的模型,专为大规模使用而设计。',
528-
displayName: 'Gemini 2.5 Flash-Lite Preview 06-17',
529-
id: 'gemini-2.5-flash-lite-preview-06-17',
530-
maxOutput: 65_536,
531-
pricing: {
532-
units: [
533-
{ name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
534-
{ name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
535-
{ name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
536-
],
537-
},
538-
releasedAt: '2025-06-11',
539-
settings: {
540-
extendParams: ['thinkingBudget', 'urlContext'],
541-
searchImpl: 'params',
542-
searchProvider: 'google',
543-
},
544-
type: 'chat',
545-
},
546501
{
547502
abilities: {
548503
functionCall: true,
@@ -597,26 +552,6 @@ const googleChatModels: AIChatModelCard[] = [
597552
},
598553
type: 'chat',
599554
},
600-
{
601-
abilities: {
602-
imageOutput: true,
603-
vision: true,
604-
},
605-
contextWindowTokens: 32_768 + 8192,
606-
description: 'Gemini 2.0 Flash 预览模型,支持图像生成',
607-
displayName: 'Gemini 2.0 Flash Preview Image Generation',
608-
id: 'gemini-2.0-flash-preview-image-generation',
609-
maxOutput: 8192,
610-
pricing: {
611-
units: [
612-
{ name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
613-
{ name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
614-
{ name: 'imageGeneration', rate: 0.039, strategy: 'fixed', unit: 'image' },
615-
],
616-
},
617-
releasedAt: '2025-05-07',
618-
type: 'chat',
619-
},
620555
{
621556
abilities: {
622557
imageOutput: true,

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ const ollamaCloudModels: AIChatModelCard[] = [
55
abilities: {
66
functionCall: true,
77
reasoning: true,
8+
vision: true,
89
},
9-
contextWindowTokens: 200_000,
10-
description: 'MiniMax M2 是专为编码和代理工作流程构建的高效大型语言模型。',
11-
displayName: 'MiniMax M2',
10+
contextWindowTokens: 1_048_576,
11+
description:
12+
'Gemini 3 Pro 是 Google 最智能的模型,具有 SOTA 推理和多模式理解,以及强大的代理和氛围编码功能。',
13+
displayName: 'Gemini 3 Pro Preview',
1214
enabled: true,
13-
id: 'minimax-m2',
15+
id: 'gemini-3-pro-preview',
1416
type: 'chat',
1517
},
1618
{
@@ -19,8 +21,7 @@ const ollamaCloudModels: AIChatModelCard[] = [
1921
reasoning: true,
2022
},
2123
contextWindowTokens: 200_000,
22-
description:
23-
'MiniMax M2 是专为编码和代理工作流程构建的高效大型语言模型。',
24+
description: 'MiniMax M2 是专为编码和代理工作流程构建的高效大型语言模型。',
2425
displayName: 'MiniMax M2',
2526
enabled: true,
2627
id: 'minimax-m2',

packages/model-bank/src/types/aiModel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ export type ExtendParamsType =
242242
| 'textVerbosity'
243243
| 'thinking'
244244
| 'thinkingBudget'
245+
| 'thinkingLevel'
245246
| 'urlContext';
246247

247248
export interface AiModelSettings {

packages/model-runtime/src/providers/google/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class LobeGoogleAI implements LobeRuntimeAI {
194194
async chat(rawPayload: ChatStreamPayload, options?: ChatMethodOptions) {
195195
try {
196196
const payload = this.buildPayload(rawPayload);
197-
const { model, thinkingBudget } = payload;
197+
const { model, thinkingBudget, thinkingLevel } = payload;
198198

199199
// https://ai.google.dev/gemini-api/docs/thinking#set-budget
200200
const resolvedThinkingBudget = resolveModelThinkingBudget(model, thinkingBudget);
@@ -209,6 +209,11 @@ export class LobeGoogleAI implements LobeRuntimeAI {
209209
thinkingBudget: resolvedThinkingBudget,
210210
};
211211

212+
// Add thinkingLevel for 3.0 models
213+
if (model?.toLowerCase().includes('-3-') && thinkingLevel) {
214+
(thinkingConfig as any).thinkingLevel = thinkingLevel;
215+
}
216+
212217
const contents = await buildGoogleMessages(payload.messages);
213218

214219
const controller = new AbortController();

packages/model-runtime/src/types/chat.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ export interface ChatStreamPayload {
124124
type: 'enabled' | 'disabled';
125125
};
126126
thinkingBudget?: number;
127+
/**
128+
* Thinking level for Gemini models (e.g., gemini-3.0-pro)
129+
*/
130+
thinkingLevel?: 'low' | 'high';
127131
tool_choice?: string;
128132
tools?: ChatCompletionTool[];
129133
/**

packages/types/src/agent/chatConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface LobeAgentChatConfig {
3838
*/
3939
textVerbosity?: 'low' | 'medium' | 'high';
4040
thinking?: 'disabled' | 'auto' | 'enabled';
41+
thinkingLevel?: 'low' | 'high';
4142
thinkingBudget?: number;
4243
/**
4344
* Disable context caching
@@ -91,6 +92,7 @@ export const AgentChatConfigSchema = z.object({
9192
textVerbosity: z.enum(['low', 'medium', 'high']).optional(),
9293
thinking: z.enum(['disabled', 'auto', 'enabled']).optional(),
9394
thinkingBudget: z.number().optional(),
95+
thinkingLevel: z.enum(['low', 'high']).optional(),
9496
urlContext: z.boolean().optional(),
9597
useModelBuiltinSearch: z.boolean().optional(),
9698
});

src/features/ChatInput/ActionBar/Model/ControlsForm.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import ReasoningEffortSlider from './ReasoningEffortSlider';
1717
import ReasoningTokenSlider from './ReasoningTokenSlider';
1818
import TextVerbositySlider from './TextVerbositySlider';
1919
import ThinkingBudgetSlider from './ThinkingBudgetSlider';
20+
import ThinkingLevelSlider from './ThinkingLevelSlider';
2021
import ThinkingSlider from './ThinkingSlider';
2122

2223
const ControlsForm = memo(() => {
@@ -177,6 +178,16 @@ const ControlsForm = memo(() => {
177178
paddingBottom: 0,
178179
},
179180
},
181+
{
182+
children: <ThinkingLevelSlider />,
183+
label: t('extendParams.thinkingLevel.title'),
184+
layout: 'horizontal',
185+
minWidth: undefined,
186+
name: 'thinkingLevel',
187+
style: {
188+
paddingBottom: 0,
189+
},
190+
},
180191
].filter(Boolean) as FormItemProps[];
181192

182193
return (

0 commit comments

Comments
 (0)