From d212df8b952636937814a22f40b1b8d46f38d3d1 Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Thu, 29 Aug 2024 00:39:51 +0800 Subject: [PATCH] stash code --- app/client/platforms/openai.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index f3b488163..0eea4331c 100644 --- a/app/client/platforms/openai.ts +++ b/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;