We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b970fee commit c8ed5faCopy full SHA for c8ed5fa
Node/quickstarts/genkit-helloworld/functions/index.js
@@ -46,7 +46,7 @@ const jokeTeller = ai.defineFlow({
46
inputSchema: z.string().nullable(),
47
outputSchema: z.string(),
48
streamSchema: z.string(),
49
-}, async (jokeType = "knock-knock", response) => {
+}, async (jokeType = "knock-knock", {sendChunk}) => {
50
const prompt = `Tell me a ${jokeType} joke.`;
51
52
// Call the `generateStream()` method to
@@ -56,7 +56,7 @@ const jokeTeller = ai.defineFlow({
56
// Send new words of the generative AI response
57
// to the client as they're generated.
58
for await (const chunk of stream) {
59
- response.sendChunk(chunk.text);
+ sendChunk(chunk.text);
60
}
61
62
// Return the full generative AI response
0 commit comments