add clear

This commit is contained in:
Chuck1sn
2025-06-14 13:54:31 +08:00
parent ab72508408
commit f559e4cde3
4 changed files with 1876 additions and 1802 deletions

View File

@@ -117,6 +117,11 @@ export const useAiChat = () => {
}
};
const clearConversation = async () => {
await client.POST("/ai/chat/refresh");
messages.value = [];
};
const cancel = () => {
if (currentController) {
currentController.abort();
@@ -124,5 +129,13 @@ export const useAiChat = () => {
}
};
return { messages, chat, isLoading, cancel, searchAction, executeAction };
return {
messages,
chat,
isLoading,
cancel,
searchAction,
executeAction,
clearConversation,
};
};