From c5f780671811a9dccce94ceac677a6ff94c0f872 Mon Sep 17 00:00:00 2001 From: Muyue Date: Sat, 18 Oct 2025 23:07:32 +0200 Subject: [PATCH] Fix: Make generateAgentResponse an async generator function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generateAgentResponse function uses 'yield' to stream responses, so it must be declared as an async generator function (async function*) instead of a regular async function. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/src/services/mistralClient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/services/mistralClient.js b/backend/src/services/mistralClient.js index aab3efc..9e35a16 100644 --- a/backend/src/services/mistralClient.js +++ b/backend/src/services/mistralClient.js @@ -98,7 +98,7 @@ async function* parseStreamResponse(reader) { /** * Generate agent response with streaming thoughts */ -export async function generateAgentResponse(agentName, prompt, currentDocument = '', onThought = null) { +export async function* generateAgentResponse(agentName, prompt, currentDocument = '', onThought = null) { const systemPrompt = getAgentPrompt(agentName) const messages = [