GenkitG
Genkit•2y ago•
2 replies
inadequate-blush

```go

            resp, err := ai.Generate(ctx, vertexai.Model("gemini-1.5-pro"),
                ai.WithSystemPrompt("You are a helpful assistant"),
                ai.WithTextPrompt("Tell a story "),
                ai.WithStreaming(
                    func(ctx context.Context, grc *ai.GenerateResponseChunk) error {
                        if cb != nil {
                            if err := cb(ctx, grc.Text()); err != nil {
                                return err
                            }
                        }
                        return nil
                    }),
            )
Was this page helpful?