Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

desktop: capture text from last chunk of response

Jeffrey Morgan4ef886b1d840
diff --git a/desktop/src/app.tsx b/desktop/src/app.tsx
index 0a5e5bc7e..380709f91 100644
--- a/desktop/src/app.tsx
+++ b/desktop/src/app.tsx
@@ -46,11 +46,12 @@ async function generate(prompt: string, model: string, callback: (res: string) =
for (const message of messages) {
const choice = message.choices[0]
+
+ callback(choice.text)
+
if (choice.finish_reason === 'stop') {
break
}
-
- callback(choice.text)
}
}