mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-11 17:20:13 +01:00
47b7df4fc3
clear chat window on /reset
33 lines
692 B
JavaScript
33 lines
692 B
JavaScript
const { WorkspaceChats } = require("../../../models/workspaceChats");
|
|
|
|
async function resetMemory(
|
|
workspace,
|
|
_message,
|
|
msgUUID,
|
|
user = null,
|
|
thread = null
|
|
) {
|
|
// If thread is present we are wanting to reset this specific thread. Not the whole workspace.
|
|
thread
|
|
? await WorkspaceChats.markThreadHistoryInvalid(
|
|
workspace.id,
|
|
user,
|
|
thread.id
|
|
)
|
|
: await WorkspaceChats.markHistoryInvalid(workspace.id, user);
|
|
|
|
return {
|
|
uuid: msgUUID,
|
|
type: "textResponse",
|
|
textResponse: "Workspace chat memory was reset!",
|
|
sources: [],
|
|
close: true,
|
|
error: false,
|
|
action: "reset_chat",
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
resetMemory,
|
|
};
|