mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
parent
23f6ab7c5e
commit
7df587d9a4
@ -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 != "") {
|
||||
|
Loading…
Reference in New Issue
Block a user