diff --git a/app/store/chat.ts b/app/store/chat.ts index c18aa2bc..cb11087d 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -252,9 +252,20 @@ export const useChatStore = create()( 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 + const systemMessages = [systemInfo]; const recentMessages = get().getMessagesWithMemory(); - const sendMessages = recentMessages.concat(userMessage); + const sendMessages = systemMessages.concat( + recentMessages.concat(userMessage), + ); const sessionIndex = get().currentSessionIndex; const messageIndex = get().currentSession().messages.length + 1;