File tree 1 file changed +3
-3
lines changed
Node/quickstarts/genkit-helloworld/functions
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const jokeTeller = ai.defineFlow({
46
46
inputSchema : z . string ( ) . nullable ( ) ,
47
47
outputSchema : z . string ( ) ,
48
48
streamSchema : z . string ( ) ,
49
- } , async ( jokeType = "knock-knock" , response ) => {
49
+ } , async ( jokeType = "knock-knock" , { sendChunk } ) => {
50
50
const prompt = `Tell me a ${ jokeType } joke.` ;
51
51
52
52
// Call the `generateStream()` method to
@@ -56,7 +56,7 @@ const jokeTeller = ai.defineFlow({
56
56
// Send new words of the generative AI response
57
57
// to the client as they are generated.
58
58
for await ( const chunk of stream ) {
59
- response . sendChunk ( chunk . text ) ;
59
+ sendChunk ( chunk . text ) ;
60
60
}
61
61
62
62
// Return the full generative AI response
@@ -74,7 +74,7 @@ exports.tellJoke = onCallGenkit({
74
74
// [END bind-secrets]
75
75
// [START auth-policy]
76
76
// Protect your endpoint with authPolicy.
77
- // authPolicy: (auth) => !!auth?.token.email_verified,
77
+ authPolicy : ( auth ) => ! ! auth ?. token . email_verified ,
78
78
// [END auth-policy]
79
79
} ,
80
80
// Pass in the genkit flow.
You can’t perform that action at this time.
0 commit comments