From 611588a67d421717c8fdcc383a1f705dba5428d0 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 29 Apr 2025 11:39:12 -0700 Subject: [PATCH] render chat --- core/llm/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index 1f7684652..aa115fb71 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -71,7 +71,11 @@ export class LLMError extends Error { } export function isModelInstaller(provider: any): provider is ModelInstaller { - return provider && typeof provider.installModel === "function" && typeof provider.isInstallingModel === "function";; + return ( + provider && + typeof provider.installModel === "function" && + typeof provider.isInstallingModel === "function" + ); } type InteractionStatus = "in_progress" | "success" | "error" | "cancelled"; @@ -816,8 +820,8 @@ export abstract class BaseLLM implements ILLM { options: LLMFullCompletionOptions = {}, ) { let completion = ""; - for await (const chunk of this.streamChat(messages, signal, options)) { - completion += chunk.content; + for await (const message of this.streamChat(messages, signal, options)) { + completion += renderChatMessage(message); } return { role: "assistant" as const, content: completion }; }