Skip to content

Commit 0dcd337

Browse files
committed
Merge branch 'main' of github.com:firebase/functions-samples
2 parents 735bbe5 + c8ed5fa commit 0dcd337

File tree

1 file changed

+3
-3
lines changed
  • Node/quickstarts/genkit-helloworld/functions

1 file changed

+3
-3
lines changed

Diff for: Node/quickstarts/genkit-helloworld/functions/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const jokeTeller = ai.defineFlow({
4646
inputSchema: z.string().nullable(),
4747
outputSchema: z.string(),
4848
streamSchema: z.string(),
49-
}, async (jokeType = "knock-knock", response) => {
49+
}, async (jokeType = "knock-knock", {sendChunk}) => {
5050
const prompt = `Tell me a ${jokeType} joke.`;
5151

5252
// Call the `generateStream()` method to
@@ -56,7 +56,7 @@ const jokeTeller = ai.defineFlow({
5656
// Send new words of the generative AI response
5757
// to the client as they are generated.
5858
for await (const chunk of stream) {
59-
response.sendChunk(chunk.text);
59+
sendChunk(chunk.text);
6060
}
6161

6262
// Return the full generative AI response
@@ -74,7 +74,7 @@ exports.tellJoke = onCallGenkit({
7474
// [END bind-secrets]
7575
// [START auth-policy]
7676
// Protect your endpoint with authPolicy.
77-
// authPolicy: (auth) => !!auth?.token.email_verified,
77+
authPolicy: (auth) => !!auth?.token.email_verified,
7878
// [END auth-policy]
7979
},
8080
// Pass in the genkit flow.

0 commit comments

Comments
 (0)