Skip to content

Commit 1a6f87b

Browse files
committed
feat: qwen3 config
1 parent e100827 commit 1a6f87b

File tree

4 files changed

+244
-29
lines changed

4 files changed

+244
-29
lines changed

docSite/content/zh-cn/docs/development/upgrading/498.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ weight: 792
1010

1111
## 🚀 新增内容
1212

13-
1. 支持 Streamable http mcp 模式,无需额外安装 mcp_server 即可以 MCP 方式对外提供 fastgpt 调用。
13+
1. qwen3 模型预设
1414

1515
## ⚙️ 优化
1616

packages/service/core/ai/config/provider/Qwen.json

Lines changed: 228 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
11
{
22
"provider": "Qwen",
33
"list": [
4+
{
5+
"model": "qwen-vl-plus",
6+
"name": "qwen-vl-plus",
7+
"maxContext": 32000,
8+
"maxResponse": 2000,
9+
"quoteMaxToken": 20000,
10+
"maxTemperature": 1.2,
11+
"vision": true,
12+
"toolChoice": false,
13+
"functionCall": false,
14+
"defaultSystemChatPrompt": "",
15+
"datasetProcess": true,
16+
"usedInClassify": true,
17+
"customCQPrompt": "",
18+
"usedInExtractFields": true,
19+
"usedInQueryExtension": true,
20+
"customExtractPrompt": "",
21+
"usedInToolCall": true,
22+
"type": "llm",
23+
"showTopP": true,
24+
"showStopSign": true
25+
},
26+
{
27+
"model": "qwen-plus",
28+
"name": "Qwen-plus",
29+
"maxContext": 64000,
30+
"maxResponse": 8000,
31+
"quoteMaxToken": 60000,
32+
"maxTemperature": 1,
33+
"vision": false,
34+
"toolChoice": true,
35+
"functionCall": false,
36+
"defaultSystemChatPrompt": "",
37+
"datasetProcess": true,
38+
"usedInClassify": true,
39+
"customCQPrompt": "",
40+
"usedInExtractFields": true,
41+
"usedInQueryExtension": true,
42+
"customExtractPrompt": "",
43+
"usedInToolCall": true,
44+
"defaultConfig": {},
45+
"fieldMap": {},
46+
"type": "llm",
47+
"showTopP": true,
48+
"showStopSign": true,
49+
"responseFormatList": ["text", "json_object"]
50+
},
451
{
552
"model": "qwen-turbo",
653
"name": "Qwen-turbo",
@@ -26,12 +73,13 @@
2673
"showStopSign": true,
2774
"responseFormatList": ["text", "json_object"]
2875
},
76+
2977
{
30-
"model": "qwen-plus",
31-
"name": "Qwen-plus",
32-
"maxContext": 64000,
33-
"maxResponse": 8000,
34-
"quoteMaxToken": 60000,
78+
"model": "qwen-max",
79+
"name": "Qwen-max",
80+
"maxContext": 32000,
81+
"maxResponse": 4000,
82+
"quoteMaxToken": 6000,
3583
"maxTemperature": 1,
3684
"vision": false,
3785
"toolChoice": true,
@@ -52,8 +100,8 @@
52100
"responseFormatList": ["text", "json_object"]
53101
},
54102
{
55-
"model": "qwen-vl-plus",
56-
"name": "qwen-vl-plus",
103+
"model": "qwen-vl-max",
104+
"name": "qwen-vl-max",
57105
"maxContext": 32000,
58106
"maxResponse": 2000,
59107
"quoteMaxToken": 20000,
@@ -69,18 +117,177 @@
69117
"usedInQueryExtension": true,
70118
"customExtractPrompt": "",
71119
"usedInToolCall": true,
120+
"defaultConfig": {},
121+
"fieldMap": {},
72122
"type": "llm",
73123
"showTopP": true,
74124
"showStopSign": true
75125
},
76126
{
77-
"model": "qwen-max",
78-
"name": "Qwen-max",
127+
"model": "qwen3-235b-a22b",
128+
"name": "qwen3-235b-a22b",
129+
"maxContext": 128000,
130+
"maxResponse": 8000,
131+
"quoteMaxToken": 100000,
132+
"maxTemperature": 1,
133+
"vision": false,
134+
"reasoning": true,
135+
"toolChoice": true,
136+
"functionCall": false,
137+
"defaultSystemChatPrompt": "",
138+
"datasetProcess": true,
139+
"usedInClassify": true,
140+
"customCQPrompt": "",
141+
"usedInExtractFields": true,
142+
"usedInQueryExtension": true,
143+
"customExtractPrompt": "",
144+
"usedInToolCall": true,
145+
"defaultConfig": {},
146+
"fieldMap": {},
147+
"type": "llm",
148+
"showTopP": true,
149+
"showStopSign": true,
150+
"responseFormatList": ["text", "json_object"]
151+
},
152+
{
153+
"model": "qwen3-32b",
154+
"name": "qwen3-32b",
155+
"maxContext": 128000,
156+
"maxResponse": 8000,
157+
"quoteMaxToken": 100000,
158+
"maxTemperature": 1,
159+
"vision": false,
160+
"reasoning": true,
161+
"toolChoice": true,
162+
"functionCall": false,
163+
"defaultSystemChatPrompt": "",
164+
"datasetProcess": true,
165+
"usedInClassify": true,
166+
"customCQPrompt": "",
167+
"usedInExtractFields": true,
168+
"usedInQueryExtension": true,
169+
"customExtractPrompt": "",
170+
"usedInToolCall": true,
171+
"defaultConfig": {},
172+
"fieldMap": {},
173+
"type": "llm",
174+
"showTopP": true,
175+
"showStopSign": true,
176+
"responseFormatList": ["text", "json_object"]
177+
},
178+
{
179+
"model": "qwen3-30b-a3b",
180+
"name": "qwen3-30b-a3b",
181+
"maxContext": 128000,
182+
"maxResponse": 8000,
183+
"quoteMaxToken": 100000,
184+
"maxTemperature": 1,
185+
"vision": false,
186+
"reasoning": true,
187+
"toolChoice": true,
188+
"functionCall": false,
189+
"defaultSystemChatPrompt": "",
190+
"datasetProcess": true,
191+
"usedInClassify": true,
192+
"customCQPrompt": "",
193+
"usedInExtractFields": true,
194+
"usedInQueryExtension": true,
195+
"customExtractPrompt": "",
196+
"usedInToolCall": true,
197+
"defaultConfig": {},
198+
"fieldMap": {},
199+
"type": "llm",
200+
"showTopP": true,
201+
"showStopSign": true,
202+
"responseFormatList": ["text", "json_object"]
203+
},
204+
{
205+
"model": "qwen3-14b",
206+
"name": "qwen3-14b",
207+
"maxContext": 128000,
208+
"maxResponse": 8000,
209+
"quoteMaxToken": 100000,
210+
"maxTemperature": 1,
211+
"vision": false,
212+
"reasoning": true,
213+
"toolChoice": true,
214+
"functionCall": false,
215+
"defaultSystemChatPrompt": "",
216+
"datasetProcess": true,
217+
"usedInClassify": true,
218+
"customCQPrompt": "",
219+
"usedInExtractFields": true,
220+
"usedInQueryExtension": true,
221+
"customExtractPrompt": "",
222+
"usedInToolCall": true,
223+
"defaultConfig": {},
224+
"fieldMap": {},
225+
"type": "llm",
226+
"showTopP": true,
227+
"showStopSign": true,
228+
"responseFormatList": ["text", "json_object"]
229+
},
230+
{
231+
"model": "qwen3-8b",
232+
"name": "qwen3-8b",
233+
"maxContext": 128000,
234+
"maxResponse": 8000,
235+
"quoteMaxToken": 100000,
236+
"maxTemperature": 1,
237+
"vision": false,
238+
"reasoning": true,
239+
"toolChoice": true,
240+
"functionCall": false,
241+
"defaultSystemChatPrompt": "",
242+
"datasetProcess": true,
243+
"usedInClassify": true,
244+
"customCQPrompt": "",
245+
"usedInExtractFields": true,
246+
"usedInQueryExtension": true,
247+
"customExtractPrompt": "",
248+
"usedInToolCall": true,
249+
"defaultConfig": {},
250+
"fieldMap": {},
251+
"type": "llm",
252+
"showTopP": true,
253+
"showStopSign": true,
254+
"responseFormatList": ["text", "json_object"]
255+
},
256+
{
257+
"model": "qwen3-4b",
258+
"name": "qwen3-4b",
259+
"maxContext": 128000,
260+
"maxResponse": 8000,
261+
"quoteMaxToken": 100000,
262+
"maxTemperature": 1,
263+
"vision": false,
264+
"reasoning": true,
265+
"toolChoice": true,
266+
"functionCall": false,
267+
"defaultSystemChatPrompt": "",
268+
"datasetProcess": true,
269+
"usedInClassify": true,
270+
"customCQPrompt": "",
271+
"usedInExtractFields": true,
272+
"usedInQueryExtension": true,
273+
"customExtractPrompt": "",
274+
"usedInToolCall": true,
275+
"defaultConfig": {},
276+
"fieldMap": {},
277+
"type": "llm",
278+
"showTopP": true,
279+
"showStopSign": true,
280+
"responseFormatList": ["text", "json_object"]
281+
},
282+
{
283+
"model": "qwen3-1.7b",
284+
"name": "qwen3-1.7b",
79285
"maxContext": 32000,
80-
"maxResponse": 4000,
81-
"quoteMaxToken": 6000,
286+
"maxResponse": 8000,
287+
"quoteMaxToken": 30000,
82288
"maxTemperature": 1,
83289
"vision": false,
290+
"reasoning": true,
84291
"toolChoice": true,
85292
"functionCall": false,
86293
"defaultSystemChatPrompt": "",
@@ -99,14 +306,15 @@
99306
"responseFormatList": ["text", "json_object"]
100307
},
101308
{
102-
"model": "qwen-vl-max",
103-
"name": "qwen-vl-max",
309+
"model": "qwen3-0.6b",
310+
"name": "qwen3-0.6b",
104311
"maxContext": 32000,
105-
"maxResponse": 2000,
106-
"quoteMaxToken": 20000,
107-
"maxTemperature": 1.2,
108-
"vision": true,
109-
"toolChoice": false,
312+
"maxResponse": 8000,
313+
"quoteMaxToken": 30000,
314+
"maxTemperature": 1,
315+
"vision": false,
316+
"reasoning": true,
317+
"toolChoice": true,
110318
"functionCall": false,
111319
"defaultSystemChatPrompt": "",
112320
"datasetProcess": true,
@@ -120,7 +328,8 @@
120328
"fieldMap": {},
121329
"type": "llm",
122330
"showTopP": true,
123-
"showStopSign": true
331+
"showStopSign": true,
332+
"responseFormatList": ["text", "json_object"]
124333
},
125334
{
126335
"model": "qwq-plus",

packages/service/core/ai/config/utils.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,23 @@ export const loadSystemModels = async (init = false) => {
110110
provider: ModelProviderIdType;
111111
list: SystemModelItemType[];
112112
};
113+
const mergeObject = (obj1: any, obj2: any) => {
114+
if (!obj1 && !obj2) return undefined;
115+
const formatObj1 = typeof obj1 === 'object' ? obj1 : {};
116+
const formatObj2 = typeof obj2 === 'object' ? obj2 : {};
117+
return { ...formatObj1, ...formatObj2 };
118+
};
113119

114120
fileContent.list.forEach((fileModel) => {
115121
const dbModel = dbModels.find((item) => item.model === fileModel.model);
116122

117123
const modelData: any = {
118124
...fileModel,
119125
...dbModel?.metadata,
126+
// @ts-ignore
127+
defaultConfig: mergeObject(fileModel.defaultConfig, dbModel?.metadata?.defaultConfig),
128+
// @ts-ignore
129+
fieldMap: mergeObject(fileModel.fieldMap, dbModel?.metadata?.fieldMap),
120130
provider: getModelProvider(dbModel?.metadata?.provider || fileContent.provider).id,
121131
type: dbModel?.metadata?.type || fileModel.type,
122132
isCustom: false

projects/app/src/pageComponents/account/model/AddModelBox.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export const ModelEditModal = ({
143143
data[key] = '';
144144
}
145145
}
146+
146147
return putSystemModel({
147148
model: data.model,
148149
metadata: data
@@ -490,7 +491,7 @@ export const ModelEditModal = ({
490491
value={JSON.stringify(getValues('defaultConfig'), null, 2)}
491492
onChange={(e) => {
492493
if (!e) {
493-
setValue('defaultConfig', {});
494+
setValue('defaultConfig', undefined);
494495
return;
495496
}
496497
try {
@@ -582,12 +583,6 @@ export const ModelEditModal = ({
582583
</Td>
583584
</Tr>
584585
<Tr>
585-
<Td>
586-
<HStack spacing={1}>
587-
<Box>{t('account:model.function_call')}</Box>
588-
<QuestionTip label={t('account:model.function_call_tip')} />
589-
</HStack>
590-
</Td>
591586
<Td textAlign={'right'}>
592587
<Flex justifyContent={'flex-end'}>
593588
<Switch {...register('functionCall')} />
@@ -720,12 +715,13 @@ export const ModelEditModal = ({
720715
value={JSON.stringify(getValues('defaultConfig'), null, 2)}
721716
resize
722717
onChange={(e) => {
718+
console.log(e, '===');
723719
if (!e) {
724-
setValue('defaultConfig', {});
720+
setValue('defaultConfig', undefined);
725721
return;
726722
}
727723
try {
728-
setValue('defaultConfig', JSON.parse(e));
724+
setValue('defaultConfig', JSON.parse(e.trim()));
729725
} catch (error) {
730726
console.error(error);
731727
}

0 commit comments

Comments
 (0)