mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-13 02:00:10 +01:00
parent
9feaad79cc
commit
47b7df4fc3
@ -17,6 +17,7 @@ export default function handleChat(
|
|||||||
error,
|
error,
|
||||||
close,
|
close,
|
||||||
chatId = null,
|
chatId = null,
|
||||||
|
action = null,
|
||||||
} = chatResult;
|
} = chatResult;
|
||||||
|
|
||||||
if (type === "abort" || type === "statusResponse") {
|
if (type === "abort" || type === "statusResponse") {
|
||||||
@ -132,6 +133,12 @@ export default function handleChat(
|
|||||||
setChatHistory([..._chatHistory]);
|
setChatHistory([..._chatHistory]);
|
||||||
setLoadingResponse(false);
|
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) {
|
export function chatPrompt(workspace) {
|
||||||
|
@ -23,6 +23,7 @@ async function resetMemory(
|
|||||||
sources: [],
|
sources: [],
|
||||||
close: true,
|
close: true,
|
||||||
error: false,
|
error: false,
|
||||||
|
action: "reset_chat",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user