diff --git a/Node/quickstarts/genkit-helloworld/functions/index.js b/Node/quickstarts/genkit-helloworld/functions/index.js index f7420194b..ba7c369d3 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 are generated. for await (const chunk of stream) { - response.sendChunk(chunk.text); + sendChunk(chunk.text); } // Return the full generative AI response @@ -74,7 +74,7 @@ exports.tellJoke = onCallGenkit({ // [END bind-secrets] // [START auth-policy] // Protect your endpoint with authPolicy. - // authPolicy: (auth) => !!auth?.token.email_verified, + authPolicy: (auth) => !!auth?.token.email_verified, // [END auth-policy] }, // Pass in the genkit flow.