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"}}'
Click to show internal directories.
Click to hide internal directories.