mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-10 17:00:11 +01:00
parent
9feaad79cc
commit
47b7df4fc3
@ -17,6 +17,7 @@ export default function handleChat(
|
||||
error,
|
||||
close,
|
||||
chatId = null,
|
||||
action = null,
|
||||
} = chatResult;
|
||||
|
||||
if (type === "abort" || type === "statusResponse") {
|
||||
@ -132,6 +133,12 @@ export default function handleChat(
|
||||
setChatHistory([..._chatHistory]);
|
||||
setLoadingResponse(false);
|
||||
}
|
||||
|
||||
// Action Handling via special 'action' attribute on response.
|
||||
if (action === "reset_chat") {
|
||||
// Chat was reset, keep reset message and clear everything else.
|
||||
setChatHistory([_chatHistory.pop()]);
|
||||
}
|
||||
}
|
||||
|
||||
export function chatPrompt(workspace) {
|
||||
|
@ -23,6 +23,7 @@ async function resetMemory(
|
||||
sources: [],
|
||||
close: true,
|
||||
error: false,
|
||||
action: "reset_chat",
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user