mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-06-05 12:20:22 +09:00
fix: MYFILES_BROWSER_TOOLS_SYSTEM_PROMPT
This commit is contained in:
parent
cdbbcb6ac3
commit
a80ac42c92
@ -36,6 +36,7 @@ import { createEmptyMask, Mask } from "./mask";
|
||||
import { FileInfo, WebApi } from "../client/platforms/utils";
|
||||
import { usePluginStore } from "./plugin";
|
||||
import { TavilySearchResponse } from "@tavily/core";
|
||||
import { MYFILES_BROWSER_TOOLS_SYSTEM_PROMPT } from "../prompt";
|
||||
|
||||
export interface ChatToolMessage {
|
||||
toolName: string;
|
||||
@ -648,13 +649,23 @@ export const useChatStore = createPersistStore(
|
||||
session.mask.modelConfig.model.startsWith("chatgpt-"));
|
||||
|
||||
var systemPrompts: ChatMessage[] = [];
|
||||
var template = DEFAULT_SYSTEM_TEMPLATE;
|
||||
if (session.attachFiles && session.attachFiles.length > 0) {
|
||||
template += MYFILES_BROWSER_TOOLS_SYSTEM_PROMPT;
|
||||
session.attachFiles.forEach((file) => {
|
||||
template += `filename: \`${file.originalFilename}\`
|
||||
partialDocument: \`\`\`
|
||||
${file.partial}
|
||||
\`\`\``;
|
||||
});
|
||||
}
|
||||
systemPrompts = shouldInjectSystemPrompts
|
||||
? [
|
||||
createMessage({
|
||||
role: "system",
|
||||
content: fillTemplateWith("", {
|
||||
...modelConfig,
|
||||
template: DEFAULT_SYSTEM_TEMPLATE,
|
||||
template: template,
|
||||
}),
|
||||
}),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user