Skip to content

Commit

Permalink
Update queryExtension.ts
Browse files Browse the repository at this point in the history
修复问题扩展历史记录问题
  • Loading branch information
c121914yu authored Apr 8, 2024
1 parent 5cfa432 commit 64db0e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/service/core/ai/functions/queryExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 - 问题扩展
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 64db0e4

Please sign in to comment.