forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #1364 from Yidadaa/client-side
feat: add model and time info to prompts
This commit is contained in:
commit
1d489cfcea
@ -252,9 +252,20 @@ export const useChatStore = create<ChatStore>()(
|
|||||||
model: modelConfig.model,
|
model: modelConfig.model,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const systemInfo = createMessage({
|
||||||
|
role: "system",
|
||||||
|
content: `IMPRTANT: You are a virtual assistant powered by the ${
|
||||||
|
modelConfig.model
|
||||||
|
} model, now time is ${new Date().toLocaleString()}}`,
|
||||||
|
id: botMessage.id! + 1,
|
||||||
|
});
|
||||||
|
|
||||||
// get recent messages
|
// get recent messages
|
||||||
|
const systemMessages = [systemInfo];
|
||||||
const recentMessages = get().getMessagesWithMemory();
|
const recentMessages = get().getMessagesWithMemory();
|
||||||
const sendMessages = recentMessages.concat(userMessage);
|
const sendMessages = systemMessages.concat(
|
||||||
|
recentMessages.concat(userMessage),
|
||||||
|
);
|
||||||
const sessionIndex = get().currentSessionIndex;
|
const sessionIndex = get().currentSessionIndex;
|
||||||
const messageIndex = get().currentSession().messages.length + 1;
|
const messageIndex = get().currentSession().messages.length + 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user