This commit is contained in:
archer
2023-05-10 19:59:19 +08:00
44 changed files with 718 additions and 368 deletions

View File

@@ -105,11 +105,12 @@ export const searchKb = async ({
: [
{
obj: ChatRoleEnum.System,
value: `我们来玩问答游戏,规则为:
1.你只能回答关于"${model.name}"的问题
2.你只能从知识库中选择内容进行回答
3.如果问题不在知识库中,你会回答"我不知道。"
务必遵守规则`
value: `一个问答游戏,规则为:
1.你完全忘记你已有的知识
2.你只回答关于"${model.name}"的问题
3.你只从知识库中选择内容进行回答
4.如果问题不在知识库中,你会回答:"我不知道。"
请务必遵守规则`
}
])
];
@@ -125,7 +126,8 @@ export const searchKb = async ({
length: Math.floor(maxTokens * rate)
})
)
.join('\n');
.join('\n')
.trim();
/* 高相似度+不回复 */
if (!filterSystemPrompt && model.chat.searchMode === ModelVectorSearchModeEnum.hightSimilarity) {
@@ -160,7 +162,7 @@ export const searchKb = async ({
searchPrompts: [
{
obj: ChatRoleEnum.System,
value: `知识库:'${filterSystemPrompt}'`
value: `知识库:${filterSystemPrompt}`
},
...fixedPrompts
]