Help us shape the future of Go! Take the 2026 Go Developer Survey

basic

command
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

This sample demonstrates the two kinds of flow:

  • jokesFlow returns its answer whole.
  • streamingJokesFlow forwards the model's chunks as they arrive.

Run it:

go run .

Or with the Dev UI, to call the flows from a browser and read a trace of every run at http://localhost:4000/traces:

curl -sL cli.genkit.dev | bash    # install the Genkit CLI, once
genkit start -- go run .

Or over HTTP. Streaming needs ?stream=true:

curl -X POST http://localhost:8080/jokesFlow \
  -H "Content-Type: application/json" \
  -d '{"data": {"topic": "bananas"}}'

curl -N -X POST 'http://localhost:8080/streamingJokesFlow?stream=true' \
  -H "Content-Type: application/json" \
  -d '{"data": {"topic": "bananas"}}'

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL