streaming

command
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 5 Imported by: 0

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

Jump to

Keyboard shortcuts

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