Преглед на файлове

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

hotfix Gemini finish twice. #4955 #4966
Lloyd Zhou преди 1 година
родител
ревизия
ba6039fc8b
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  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