Skip to content
Snippets Groups Projects
Unverified Commit 47b7df4f authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

Clear chat window on `/reset` (#1261)

clear chat window on /reset
parent 9feaad79
No related branches found
No related tags found
No related merge requests found
......@@ -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",
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment