mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-18 16:13:44 +08:00
add clear
This commit is contained in:
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user