diff --git a/Node/quickstarts/genkit-helloworld/functions/index.js b/Node/quickstarts/genkit-helloworld/functions/index.js index b93f2de667..a176bea669 100644 --- a/Node/quickstarts/genkit-helloworld/functions/index.js +++ b/Node/quickstarts/genkit-helloworld/functions/index.js @@ -46,7 +46,7 @@ const jokeTeller = ai.defineFlow({ inputSchema: z.string().nullable(), outputSchema: z.string(), streamSchema: z.string(), -}, async (jokeType = "knock-knock", response) => { +}, async (jokeType = "knock-knock", {sendChunk}) => { const prompt = `Tell me a ${jokeType} joke.`; // Call the `generateStream()` method to @@ -56,7 +56,7 @@ const jokeTeller = ai.defineFlow({ // Send new words of the generative AI response // to the client as they're generated. for await (const chunk of stream) { - response.sendChunk(chunk.text); + sendChunk(chunk.text); } // Return the full generative AI response