mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
Update queryExtension.ts
Some checks are pending
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
Some checks are pending
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Waiting to run
修复问题扩展历史记录问题
This commit is contained in:
parent
5cfa43287f
commit
64db0e4f25
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue