Update queryExtension.ts
Some checks are pending
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run

修复问题扩展历史记录问题
This commit is contained in:
Archer 2024-04-08 10:24:49 +08:00 committed by GitHub
parent 5cfa43287f
commit 64db0e4f25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();