From 64db0e4f2563c48129f547575c8cdced71b74b99 Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Mon, 8 Apr 2024 10:24:49 +0800 Subject: [PATCH] Update queryExtension.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复问题扩展历史记录问题 --- packages/service/core/ai/functions/queryExtension.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/service/core/ai/functions/queryExtension.ts b/packages/service/core/ai/functions/queryExtension.ts index 230e0f165..976f27284 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();