Skip to content

Commit 7b075ef

Browse files
authored
💄 style: fix model fetch match tag error & add Hunyuan model fetch support (#5566)
* 💄 style: fix model fetch match tag error & add model fetch support for Hunyuan * 💄 style: add `qvq-72b-preview` vision model * 💄 style: add vision tag * 💄 style: update Hunyuan model list * 🐛 fix: fix Hunyuan model fetch ci error * 💄 style: remove fc tag for Hunyuan vision model * 🐛 fix: fix ci error * 🔨 chore: support non-pglite mode
1 parent ccdd68e commit 7b075ef

File tree

7 files changed

+193
-19
lines changed

7 files changed

+193
-19
lines changed

Diff for: src/config/aiModels/hunyuan.ts

+132-12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
1414
input: 0,
1515
output: 0,
1616
},
17+
releasedAt: '2024-10-30',
1718
type: 'chat',
1819
},
1920
{
@@ -26,9 +27,10 @@ const hunyuanChatModels: AIChatModelCard[] = [
2627
maxOutput: 2000,
2728
pricing: {
2829
currency: 'CNY',
29-
input: 4.5,
30-
output: 5,
30+
input: 0.8,
31+
output: 2,
3132
},
33+
releasedAt: '2024-10-28',
3234
type: 'chat',
3335
},
3436
{
@@ -41,9 +43,10 @@ const hunyuanChatModels: AIChatModelCard[] = [
4143
maxOutput: 6000,
4244
pricing: {
4345
currency: 'CNY',
44-
input: 15,
45-
output: 60,
46+
input: 0.5,
47+
output: 2,
4648
},
49+
releasedAt: '2024-10-28',
4750
type: 'chat',
4851
},
4952
{
@@ -52,16 +55,53 @@ const hunyuanChatModels: AIChatModelCard[] = [
5255
},
5356
contextWindowTokens: 32_000,
5457
description:
55-
'混元全新一代大语言模型的预览版,采用全新的混合专家模型(MoE)结构,相比hunyuan-pro推理效率更快,效果表现更强。',
58+
'通用体验优化,包括NLP理解、文本创作、闲聊、知识问答、翻译、领域等;提升拟人性,优化模型情商;提升意图模糊时模型主动澄清能力;提升字词解析类问题的处理能力;提升创作的质量和可互动性;提升多轮体验。',
5659
displayName: 'Hunyuan Turbo',
5760
enabled: true,
61+
id: 'hunyuan-turbo-latest',
62+
maxOutput: 4000,
63+
pricing: {
64+
currency: 'CNY',
65+
input: 15,
66+
output: 50,
67+
},
68+
releasedAt: '2025-01-10',
69+
type: 'chat',
70+
},
71+
{
72+
abilities: {
73+
functionCall: true,
74+
},
75+
contextWindowTokens: 32_000,
76+
description:
77+
'本版本优化:数据指令scaling,大幅提升模型通用泛化能力;大幅提升数学、代码、逻辑推理能力;优化文本理解字词理解相关能力;优化文本创作内容生成质量',
78+
displayName: 'Hunyuan Turbo',
5879
id: 'hunyuan-turbo',
5980
maxOutput: 4000,
6081
pricing: {
6182
currency: 'CNY',
6283
input: 15,
6384
output: 50,
6485
},
86+
releasedAt: '2025-01-10',
87+
type: 'chat',
88+
},
89+
{
90+
abilities: {
91+
functionCall: true,
92+
},
93+
contextWindowTokens: 32_000,
94+
description:
95+
'本版本优化:数据指令scaling,大幅提升模型通用泛化能力;大幅提升数学、代码、逻辑推理能力;优化文本理解字词理解相关能力;优化文本创作内容生成质量',
96+
displayName: 'Hunyuan Turbo 20241223',
97+
id: 'hunyuan-turbo-20241223',
98+
maxOutput: 4000,
99+
pricing: {
100+
currency: 'CNY',
101+
input: 15,
102+
output: 50,
103+
},
104+
releasedAt: '2025-01-10',
65105
type: 'chat',
66106
},
67107
{
@@ -70,33 +110,110 @@ const hunyuanChatModels: AIChatModelCard[] = [
70110
},
71111
contextWindowTokens: 32_000,
72112
description:
73-
'万亿级参数规模 MOE-32K 长文模型。在各种 benchmark 上达到绝对领先的水平,复杂指令和推理,具备复杂数学能力,支持 functioncall,在多语言翻译、金融法律医疗等领域应用重点优化。',
74-
displayName: 'Hunyuan Pro',
113+
'hunyuan-turbo 2024 年 11 月 20 日固定版本,介于 hunyuan-turbo 和 hunyuan-turbo-latest 之间的一个版本。',
114+
displayName: 'Hunyuan Turbo 20241120',
115+
id: 'hunyuan-turbo-20241120',
116+
maxOutput: 4000,
117+
pricing: {
118+
currency: 'CNY',
119+
input: 15,
120+
output: 50,
121+
},
122+
releasedAt: '2024-11-20',
123+
type: 'chat',
124+
},
125+
{
126+
contextWindowTokens: 32_000,
127+
description:
128+
'Hunyuan-large 模型总参数量约 389B,激活参数量约 52B,是当前业界参数规模最大、效果最好的 Transformer 架构的开源 MoE 模型。',
129+
displayName: 'Hunyuan Large',
75130
enabled: true,
76-
id: 'hunyuan-pro',
131+
id: 'hunyuan-large',
77132
maxOutput: 4000,
78133
pricing: {
79134
currency: 'CNY',
80-
input: 30,
81-
output: 100,
135+
input: 4,
136+
output: 12,
137+
},
138+
releasedAt: '2024-11-20',
139+
type: 'chat',
140+
},
141+
{
142+
contextWindowTokens: 134_000,
143+
description:
144+
'擅长处理长文任务如文档摘要和文档问答等,同时也具备处理通用文本生成任务的能力。在长文本的分析和生成上表现优异,能有效应对复杂和详尽的长文内容处理需求。',
145+
displayName: 'Hunyuan Large Longcontext',
146+
enabled: true,
147+
id: 'hunyuan-large-longcontext',
148+
maxOutput: 6000,
149+
pricing: {
150+
currency: 'CNY',
151+
input: 6,
152+
output: 18,
153+
},
154+
releasedAt: '2024-12-18',
155+
type: 'chat',
156+
},
157+
{
158+
abilities: {
159+
vision: true,
160+
},
161+
contextWindowTokens: 36_000,
162+
description: '混元最新7B多模态模型,上下文窗口32K,支持中英文场景的多模态对话、图像物体识别、文档表格理解、多模态数学等,在多个维度上评测指标优于7B竞品模型。',
163+
displayName: 'Hunyuan Lite Vision',
164+
enabled: true,
165+
id: 'hunyuan-lite-vision',
166+
maxOutput: 4000,
167+
releasedAt: '2024-12-12',
168+
type: 'chat',
169+
},
170+
{
171+
abilities: {
172+
vision: true,
82173
},
174+
contextWindowTokens: 8000,
175+
description: '混元最新多模态模型,支持多语种作答,中英文能力均衡。',
176+
displayName: 'Hunyuan Standard Vision',
177+
enabled: true,
178+
id: 'hunyuan-standard-vision',
179+
maxOutput: 2000,
180+
releasedAt: '2024-12-31',
83181
type: 'chat',
84182
},
85183
{
86184
abilities: {
87185
vision: true,
88186
},
89187
contextWindowTokens: 8000,
188+
description: '混元新一代视觉语言旗舰大模型,采用全新的混合专家模型(MoE)结构,在图文理解相关的基础识别、内容创作、知识问答、分析推理等能力上相比前一代模型全面提升。',
189+
displayName: 'Hunyuan Turbo Vision',
190+
enabled: true,
191+
id: 'hunyuan-turbo-vision',
192+
maxOutput: 2000,
193+
pricing: {
194+
currency: 'CNY',
195+
input: 80,
196+
output: 80,
197+
},
198+
releasedAt: '2024-11-26',
199+
type: 'chat',
200+
},
201+
{
202+
abilities: {
203+
vision: true,
204+
},
205+
contextWindowTokens: 12_000,
90206
description: '混元最新多模态模型,支持图片+文本输入生成文本内容。',
91207
displayName: 'Hunyuan Vision',
92208
enabled: true,
93209
id: 'hunyuan-vision',
94-
maxOutput: 4000,
210+
maxOutput: 6000,
95211
pricing: {
96212
currency: 'CNY',
97213
input: 18,
98214
output: 18,
99215
},
216+
releasedAt: '2025-01-03',
100217
type: 'chat',
101218
},
102219
{
@@ -111,6 +228,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
111228
input: 4,
112229
output: 8,
113230
},
231+
releasedAt: '2024-11-12',
114232
type: 'chat',
115233
},
116234
{
@@ -128,10 +246,11 @@ const hunyuanChatModels: AIChatModelCard[] = [
128246
input: 4,
129247
output: 8,
130248
},
249+
releasedAt: '2024-11-15',
131250
type: 'chat',
132251
},
133252
{
134-
contextWindowTokens: 8000,
253+
contextWindowTokens: 32_000,
135254
description:
136255
'混元最新版角色扮演模型,混元官方精调训练推出的角色扮演模型,基于混元模型结合角色扮演场景数据集进行增训,在角色扮演场景具有更好的基础效果。',
137256
displayName: 'Hunyuan Role',
@@ -142,6 +261,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
142261
input: 4,
143262
output: 8,
144263
},
264+
releasedAt: '2024-07-04',
145265
type: 'chat',
146266
},
147267
];

Diff for: src/config/aiModels/qwen.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,26 @@ const qwenChatModels: AIChatModelCard[] = [
152152
id: 'qwq-32b-preview',
153153
pricing: {
154154
currency: 'CNY',
155-
input: 0,
156-
output: 0,
155+
input: 3.5,
156+
output: 7,
157+
},
158+
releasedAt: '2024-11-28',
159+
type: 'chat',
160+
},
161+
{
162+
abilities: {
163+
vision: true,
164+
},
165+
contextWindowTokens: 32_768,
166+
description: 'QVQ模型是由 Qwen 团队开发的实验性研究模型,专注于提升视觉推理能力,尤其在数学推理领域。',
167+
displayName: 'QVQ 72B Preview',
168+
id: 'qvq-72b-preview',
169+
pricing: {
170+
currency: 'CNY',
171+
input: 12,
172+
output: 36,
157173
},
174+
releasedAt: '2024-12-25',
158175
type: 'chat',
159176
},
160177
{

Diff for: src/config/modelProviders/hunyuan.ts

+2
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ const Hunyuan: ModelProviderCard = {
135135
'由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力',
136136
disableBrowserRequest: true,
137137
id: 'hunyuan',
138+
modelList: { showModelFetcher: true },
138139
modelsUrl: 'https://cloud.tencent.com/document/product/1729/104753',
139140
name: 'Hunyuan',
140141
settings: {
141142
disableBrowserRequest: true,
142143
sdkType: 'openai',
144+
showModelFetcher: true,
143145
},
144146
url: 'https://hunyuan.tencent.com',
145147
};

Diff for: src/libs/agent-runtime/deepseek/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const LobeDeepSeekAI = LobeOpenAICompatibleFactory({
4040

4141
return {
4242
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
43-
functionCall: true,
43+
functionCall: !model.id.toLowerCase().includes('deepseek-reasoner'),
4444
id: model.id,
4545
};
4646
},

Diff for: src/libs/agent-runtime/hunyuan/index.ts

+24
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
import { ModelProvider } from '../types';
22
import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
33

4+
import { LOBE_DEFAULT_MODEL_LIST } from '@/config/aiModels';
5+
6+
export interface HunyuanModelCard {
7+
id: string;
8+
}
9+
410
export const LobeHunyuanAI = LobeOpenAICompatibleFactory({
511
baseURL: 'https://api.hunyuan.cloud.tencent.com/v1',
612
debug: {
713
chatCompletion: () => process.env.DEBUG_HUNYUAN_CHAT_COMPLETION === '1',
814
},
15+
models: {
16+
transformModel: (m) => {
17+
const functionCallKeywords = [
18+
'hunyuan-functioncall',
19+
'hunyuan-turbo',
20+
'hunyuan-pro',
21+
];
22+
23+
const model = m as unknown as HunyuanModelCard;
24+
25+
return {
26+
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
27+
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)) && !model.id.toLowerCase().includes('vision'),
28+
id: model.id,
29+
vision: model.id.toLowerCase().includes('vision'),
30+
};
31+
},
32+
},
933
provider: ModelProvider.Hunyuan,
1034
});

Diff for: src/libs/agent-runtime/qwen/index.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
4949
: undefined,
5050
stream: !payload.tools,
5151
temperature: (temperature !== undefined && temperature >= 0 && temperature < 2) ? temperature : undefined,
52-
...(model.startsWith('qwen-vl') ? {
52+
...(model.startsWith('qvq') || model.startsWith('qwen-vl') ? {
5353
top_p: (top_p !== undefined && top_p > 0 && top_p <= 1) ? top_p : undefined,
5454
} : {
5555
top_p: (top_p !== undefined && top_p > 0 && top_p < 1) ? top_p : undefined,
@@ -67,7 +67,7 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
6767
debug: {
6868
chatCompletion: () => process.env.DEBUG_QWEN_CHAT_COMPLETION === '1',
6969
},
70-
models: {
70+
models: {
7171
transformModel: (m) => {
7272
const functionCallKeywords = [
7373
'qwen-max',
@@ -76,13 +76,18 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
7676
'qwen2.5',
7777
];
7878

79+
const visionKeywords = [
80+
'qvq',
81+
'vl',
82+
];
83+
7984
const model = m as unknown as QwenModelCard;
8085

8186
return {
8287
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
8388
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
8489
id: model.id,
85-
vision: model.id.toLowerCase().includes('vl'),
90+
vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
8691
};
8792
},
8893
},

Diff for: src/libs/agent-runtime/stepfun/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export const LobeStepfunAI = LobeOpenAICompatibleFactory({
2525
// ref: https://platform.stepfun.com/docs/llm/modeloverview
2626
const functionCallKeywords = [
2727
'step-1-',
28+
'step-1o-',
29+
'step-1v-',
2830
'step-2-',
31+
];
32+
33+
const visionKeywords = [
34+
'step-1o-',
2935
'step-1v-',
3036
];
3137

@@ -35,7 +41,7 @@ export const LobeStepfunAI = LobeOpenAICompatibleFactory({
3541
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
3642
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
3743
id: model.id,
38-
vision: model.id.toLowerCase().includes('v'),
44+
vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
3945
};
4046
},
4147
},

0 commit comments

Comments
 (0)