diff --git a/packages/service/core/ai/functions/queryExtension.ts b/packages/service/core/ai/functions/queryExtension.ts index 230e0f16500..976f2728478 100644 --- a/packages/service/core/ai/functions/queryExtension.ts +++ b/packages/service/core/ai/functions/queryExtension.ts @@ -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();