Fix: Make generateAgentResponse an async generator function

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 <noreply@anthropic.com>
This commit is contained in:
Augustin ROUX 2025-10-18 23:07:32 +02:00
parent 1a7e0d218e
commit c5f7806718

View File

@ -98,7 +98,7 @@ async function* parseStreamResponse(reader) {
/** /**
* Generate agent response with streaming thoughts * 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 systemPrompt = getAgentPrompt(agentName)
const messages = [ const messages = [