mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-21 11:43:56 +00:00
feat: qwen qwq model config (#4008)
This commit is contained in:
@@ -173,6 +173,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv490' \
|
|||||||
1. PDF增强解析交互添加到页面上。同时内嵌 Doc2x 服务,可直接使用 Doc2x 服务解析 PDF 文件。
|
1. PDF增强解析交互添加到页面上。同时内嵌 Doc2x 服务,可直接使用 Doc2x 服务解析 PDF 文件。
|
||||||
2. 图片自动标注,同时修改知识库文件上传部分数据逻辑和交互。
|
2. 图片自动标注,同时修改知识库文件上传部分数据逻辑和交互。
|
||||||
3. pg vector 插件升级 0.8.0 版本,引入迭代搜索,减少部分数据无法被检索的情况。
|
3. pg vector 插件升级 0.8.0 版本,引入迭代搜索,减少部分数据无法被检索的情况。
|
||||||
|
4. 新增 qwen-qwq 系列模型配置。
|
||||||
|
|
||||||
## ⚙️ 优化
|
## ⚙️ 优化
|
||||||
|
|
||||||
|
@@ -122,6 +122,54 @@
|
|||||||
"showTopP": true,
|
"showTopP": true,
|
||||||
"showStopSign": true
|
"showStopSign": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"model": "qwq-plus",
|
||||||
|
"name": "qwq-plus",
|
||||||
|
"maxContext": 128000,
|
||||||
|
"maxResponse": 8000,
|
||||||
|
"quoteMaxToken": 100000,
|
||||||
|
"maxTemperature": null,
|
||||||
|
"vision": false,
|
||||||
|
"toolChoice": true,
|
||||||
|
"functionCall": false,
|
||||||
|
"defaultSystemChatPrompt": "",
|
||||||
|
"datasetProcess": false,
|
||||||
|
"usedInClassify": false,
|
||||||
|
"customCQPrompt": "",
|
||||||
|
"usedInExtractFields": false,
|
||||||
|
"usedInQueryExtension": false,
|
||||||
|
"customExtractPrompt": "",
|
||||||
|
"usedInToolCall": true,
|
||||||
|
"defaultConfig": {},
|
||||||
|
"fieldMap": {},
|
||||||
|
"type": "llm",
|
||||||
|
"showTopP": false,
|
||||||
|
"showStopSign": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "qwq-32b",
|
||||||
|
"name": "qwq-32b",
|
||||||
|
"maxContext": 128000,
|
||||||
|
"maxResponse": 8000,
|
||||||
|
"quoteMaxToken": 100000,
|
||||||
|
"maxTemperature": null,
|
||||||
|
"vision": false,
|
||||||
|
"toolChoice": true,
|
||||||
|
"functionCall": false,
|
||||||
|
"defaultSystemChatPrompt": "",
|
||||||
|
"datasetProcess": false,
|
||||||
|
"usedInClassify": false,
|
||||||
|
"customCQPrompt": "",
|
||||||
|
"usedInExtractFields": false,
|
||||||
|
"usedInQueryExtension": false,
|
||||||
|
"customExtractPrompt": "",
|
||||||
|
"usedInToolCall": true,
|
||||||
|
"defaultConfig": {},
|
||||||
|
"fieldMap": {},
|
||||||
|
"type": "llm",
|
||||||
|
"showTopP": false,
|
||||||
|
"showStopSign": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"model": "qwen-coder-turbo",
|
"model": "qwen-coder-turbo",
|
||||||
"name": "qwen-coder-turbo",
|
"name": "qwen-coder-turbo",
|
||||||
|
@@ -264,7 +264,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
if (!answerText) {
|
if (!answerText && !reasoningText) {
|
||||||
return Promise.reject(getEmptyResponseTip());
|
return Promise.reject(getEmptyResponseTip());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -80,8 +80,10 @@ const testLLMModel = async (model: LLMModelItemType) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const responseText = response.choices?.[0]?.message?.content;
|
const responseText = response.choices?.[0]?.message?.content;
|
||||||
|
// @ts-ignore
|
||||||
|
const reasoning_content = response.choices?.[0]?.message?.reasoning_content;
|
||||||
|
|
||||||
if (!responseText) {
|
if (!responseText && !reasoning_content) {
|
||||||
return Promise.reject('Model response empty');
|
return Promise.reject('Model response empty');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -204,44 +204,42 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// save chat
|
// save chat
|
||||||
if (!res.closed) {
|
const isInteractiveRequest = !!getLastInteractiveValue(histories);
|
||||||
const isInteractiveRequest = !!getLastInteractiveValue(histories);
|
const { text: userInteractiveVal } = chatValue2RuntimePrompt(userQuestion.value);
|
||||||
const { text: userInteractiveVal } = chatValue2RuntimePrompt(userQuestion.value);
|
|
||||||
|
|
||||||
const newTitle = isPlugin
|
const newTitle = isPlugin
|
||||||
? variables.cTime ?? getSystemTime(timezone)
|
? variables.cTime ?? getSystemTime(timezone)
|
||||||
: getChatTitleFromChatMessage(userQuestion);
|
: getChatTitleFromChatMessage(userQuestion);
|
||||||
|
|
||||||
const aiResponse: AIChatItemType & { dataId?: string } = {
|
const aiResponse: AIChatItemType & { dataId?: string } = {
|
||||||
dataId: responseChatItemId,
|
dataId: responseChatItemId,
|
||||||
obj: ChatRoleEnum.AI,
|
obj: ChatRoleEnum.AI,
|
||||||
value: assistantResponses,
|
value: assistantResponses,
|
||||||
[DispatchNodeResponseKeyEnum.nodeResponse]: flowResponses
|
[DispatchNodeResponseKeyEnum.nodeResponse]: flowResponses
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isInteractiveRequest) {
|
if (isInteractiveRequest) {
|
||||||
await updateInteractiveChat({
|
await updateInteractiveChat({
|
||||||
chatId,
|
chatId,
|
||||||
appId: app._id,
|
appId: app._id,
|
||||||
userInteractiveVal,
|
userInteractiveVal,
|
||||||
aiResponse,
|
aiResponse,
|
||||||
newVariables
|
newVariables
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await saveChat({
|
await saveChat({
|
||||||
chatId,
|
chatId,
|
||||||
appId: app._id,
|
appId: app._id,
|
||||||
teamId,
|
teamId,
|
||||||
tmbId: tmbId,
|
tmbId: tmbId,
|
||||||
nodes,
|
nodes,
|
||||||
appChatConfig: chatConfig,
|
appChatConfig: chatConfig,
|
||||||
variables: newVariables,
|
variables: newVariables,
|
||||||
isUpdateUseTime: false, // owner update use time
|
isUpdateUseTime: false, // owner update use time
|
||||||
newTitle,
|
newTitle,
|
||||||
source: ChatSourceEnum.test,
|
source: ChatSourceEnum.test,
|
||||||
content: [userQuestion, aiResponse]
|
content: [userQuestion, aiResponse]
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
createChatUsage({
|
createChatUsage({
|
||||||
|
Reference in New Issue
Block a user