From 7df587d9a4981d38652888743f22cba464bbf1b7 Mon Sep 17 00:00:00 2001 From: Sylvie Crowe <107814465+oneirocosm@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:14:30 -0700 Subject: [PATCH] Speed Up Ai (#911) fix: remove ai frontend throttling --- frontend/app/view/waveai/waveai.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/frontend/app/view/waveai/waveai.tsx b/frontend/app/view/waveai/waveai.tsx index bfff55358..5f282f24b 100644 --- a/frontend/app/view/waveai/waveai.tsx +++ b/frontend/app/view/waveai/waveai.tsx @@ -41,8 +41,6 @@ function promptToMsg(prompt: OpenAIPromptMessageType): ChatMessageType { }; } -const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)); - export class WaveAiModel implements ViewModel { viewType: string; blockId: string; @@ -102,14 +100,12 @@ export class WaveAiModel implements ViewModel { // Add a typing indicator set(this.addMessageAtom, typingMessage); - await sleep(1500); const parts = userMessage.text.split(" "); let currentPart = 0; while (currentPart < parts.length) { const part = parts[currentPart] + " "; set(this.updateLastMessageAtom, part, true); currentPart++; - await sleep(100); } set(this.updateLastMessageAtom, "", false); }); @@ -209,7 +205,6 @@ export class WaveAiModel implements ViewModel { } break; } - await sleep(100); } globalStore.set(this.updateLastMessageAtom, "", false); if (fullMsg != "") {