From 5d8d38bdf0f5c192bc9175e584027e481b3a5c38 Mon Sep 17 00:00:00 2001 From: jialin Date: Fri, 18 Apr 2025 11:15:53 +0800 Subject: [PATCH] fix: clear token usage when stoping chat --- src/pages/playground/hooks/use-chat-completion.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/playground/hooks/use-chat-completion.ts b/src/pages/playground/hooks/use-chat-completion.ts index bb4d3ec3..dfe9fff1 100644 --- a/src/pages/playground/hooks/use-chat-completion.ts +++ b/src/pages/playground/hooks/use-chat-completion.ts @@ -93,6 +93,7 @@ export default function useChatCompletion( const handleStopConversation = () => { controllerRef.current?.abort?.(); setLoading(false); + setTokenResult(null); }; const resetPerRequestCache = () => {