瀏覽代碼

stash code

lloydzhou 1 年之前
父節點
當前提交
d212df8b95
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/client/platforms/openai.ts

+ 2 - 2
app/client/platforms/openai.ts

@@ -338,12 +338,12 @@ export class ChatGPTApi implements LLMApi {
                   toolCallMessage,
                   ...toolCallResult,
                 );
-                setTimeout(() => {
+                requestAnimationFrame(() => {
                   // call again
                   console.log("start again");
                   running = false;
                   chatApi(chatPath, requestPayload as RequestPayload); // call fetchEventSource
-                }, 5);
+                });
               });
               console.log("try run tools", runTools.length, finished);
               return;