You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
679 B

11 months ago
11 months ago
  1. const { WorkspaceChats } = require("../../../models/workspaceChats");
  2. async function resetMemory(
  3. workspace,
  4. _message,
  5. msgUUID,
  6. user = null,
  7. thread = null
  8. ) {
  9. // If thread is present we are wanting to reset this specific thread. Not the whole workspace.
  10. thread
  11. ? await WorkspaceChats.markThreadHistoryInvalid(
  12. workspace.id,
  13. user,
  14. thread.id
  15. )
  16. : await WorkspaceChats.markHistoryInvalid(workspace.id, user);
  17. return {
  18. uuid: msgUUID,
  19. type: "textResponse",
  20. textResponse: "清空聊天记录!",
  21. sources: [],
  22. close: true,
  23. error: false,
  24. action: "reset_chat",
  25. };
  26. }
  27. module.exports = {
  28. resetMemory,
  29. };