mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 00:17:31 +00:00
Remove quote prompt in api request (#4724)
* chat completion add parsequote param (#4720) * chat completion add parsequote param * fix * perf: quote prompt --------- Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
@@ -321,13 +321,24 @@ export const Prompt_systemQuotePromptList: PromptTemplateItem[] = [
|
||||
}
|
||||
];
|
||||
|
||||
export const getQuotePrompt = (version?: string, role: 'user' | 'system' = 'user') => {
|
||||
export const getQuotePrompt = (
|
||||
version?: string,
|
||||
role: 'user' | 'system' = 'user',
|
||||
parseQuote = true
|
||||
) => {
|
||||
const quotePromptTemplates =
|
||||
role === 'user' ? Prompt_userQuotePromptList : Prompt_systemQuotePromptList;
|
||||
|
||||
const defaultTemplate = quotePromptTemplates[0].value;
|
||||
|
||||
return getPromptByVersion(version, defaultTemplate);
|
||||
return parseQuote
|
||||
? getPromptByVersion(version, defaultTemplate)
|
||||
: getPromptByVersion(version, defaultTemplate).replace(
|
||||
`- 使用 [id](QUOTE) 格式来引用<Reference></Reference>中的知识,其中 QUOTE 是固定常量, id 为引文中的 id。
|
||||
- 在每段结尾自然地整合引用。例如: "FastGPT 是一个基于大语言模型(LLM)的知识库问答系统[67e517e74767063e882d6861](QUOTE)。"
|
||||
- 每段至少包含一个引用,也可根据内容需要加入多个引用,按顺序排列。`,
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
// Document quote prompt
|
||||
|
Reference in New Issue
Block a user