Fix UI/UX Page Chats [Memory Prompt] [Stored Local Storage]

- [+] fix(chat.ts): update the memory prompt in onFinish callback
- [+] feat(chat.ts): update the current session with lastSummarizeIndex and memoryPrompt
This commit is contained in:
H0llyW00dzZ 2023-11-25 05:03:34 +07:00
parent b21931c667
commit ef9e86b50d
No known key found for this signature in database
GPG Key ID: 05C7FFFC0845C930

View File

@ -557,7 +557,10 @@ export const useChatStore = createPersistStore(
},
onFinish(message) {
console.log("[Memory] ", message);
session.lastSummarizeIndex = lastSummarizeIndex;
get().updateCurrentSession((session) => {
session.lastSummarizeIndex = lastSummarizeIndex;
session.memoryPrompt = message; // Update the memory prompt for stored it in local storage
});
},
onError(err) {
console.error("[Summarize] ", err);