Commit 64db0e4f by Archer Committed by GitHub

Update queryExtension.ts

修复问题扩展历史记录问题
parent 5cfa4328
......@@ -3,6 +3,7 @@ import { getAIApi } from '../config';
import { ChatItemType } from '@fastgpt/global/core/chat/type';
import { countGptMessagesTokens } from '@fastgpt/global/common/string/tiktoken';
import { ChatCompletionMessageParam } from '@fastgpt/global/core/ai/type';
import { chatValue2RuntimePrompt } from '@fastgpt/global/core/chat/adapt';
/*
query extension - 问题扩展
......@@ -117,7 +118,7 @@ A: ${chatBg}
const historyFewShot = histories
.map((item) => {
const role = item.obj === 'Human' ? 'Q' : 'A';
return `${role}: ${item.value}`;
return `${role}: ${chatValue2RuntimePrompt(item.value).text}`;
})
.join('\n');
const concatFewShot = `${systemFewShot}${historyFewShot}`.trim();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment