From 6885812d213ea372d004994d58718da7dd6f0d41 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Wed, 10 Jul 2024 18:59:44 +0800 Subject: [PATCH] hotfix Gemini finish twice. #4955 #4966 --- app/client/platforms/google.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index 4aac1dbff99..828b28a0d4d 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -154,8 +154,10 @@ export class GeminiProApi implements LLMApi { let finished = false; const finish = () => { - finished = true; - options.onFinish(responseText + remainText); + if (!finished) { + finished = true; + options.onFinish(responseText + remainText); + } }; // animate response to make it looks smooth