Documentation
¶
Overview ¶
Command streaming consumes a response as a live event stream instead of waiting for the final message.
It shows the difference from the basic example: Stream returns a channel of Event values that report incremental progress. Here it prints each text delta as it arrives, then stops on the single terminal EventDone (or EventError). Complete is just this loop wrapped up when you only want the final message.
The API key is read from the provider's environment variable when StreamOptions.APIKey is empty:
DEEPSEEK_API_KEY=sk-... go run ./example/llm/streaming
Click to show internal directories.
Click to hide internal directories.