θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions frontend/src/utils/chat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function handleChat(
error,
close,
chatId = null,
action = null,
} = chatResult;

if (type === "abort" || type === "statusResponse") {
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions server/utils/chats/commands/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function resetMemory(
sources: [],
close: true,
error: false,
action: "reset_chat",
};
}

Expand Down