chore: auto concat messages

This commit is contained in:
Fred Liang
2023-12-25 04:33:47 +08:00
parent cad461b121
commit 199f29e63c
2 changed files with 30 additions and 26 deletions

View File

@@ -389,24 +389,22 @@ export const useChatStore = createPersistStore(
const shouldInjectSystemPrompts = modelConfig.enableInjectSystemPrompts;
var systemPrompts: ChatMessage[] = [];
if (modelConfig.model !== "gemini-pro") {
systemPrompts = shouldInjectSystemPrompts
? [
createMessage({
role: "system",
content: fillTemplateWith("", {
...modelConfig,
template: DEFAULT_SYSTEM_TEMPLATE,
}),
systemPrompts = shouldInjectSystemPrompts
? [
createMessage({
role: "system",
content: fillTemplateWith("", {
...modelConfig,
template: DEFAULT_SYSTEM_TEMPLATE,
}),
]
: [];
if (shouldInjectSystemPrompts) {
console.log(
"[Global System Prompt] ",
systemPrompts.at(0)?.content ?? "empty",
);
}
}),
]
: [];
if (shouldInjectSystemPrompts) {
console.log(
"[Global System Prompt] ",
systemPrompts.at(0)?.content ?? "empty",
);
}
// long term memory