Browse Source

Merge pull request #4968 from ConnectAI-E/hotfix/google

hotfix Gemini finish twice. #4955 #4966
Lloyd Zhou 1 năm trước cách đây
mục cha
commit
ba6039fc8b
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      app/client/platforms/google.ts

+ 4 - 2
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