Capabilities
Streaming
Server-sent event streaming of text, thinking, and tool-call deltas
Read this when
- Implementing or debugging a streaming provider adapter
- Understanding which providers stream tool-call arguments
All major providers expose Server-Sent Events for incremental output. pi-go’s TextProvider.StreamText returns an EventStream that yields typed deltas (text_delta, thinking_delta, tool_delta).
Compatibility
| Provider | API | pi-go | Notes |
|---|---|---|---|
| Anthropic | ✅ SSE with fine-grained tool-call streaming | ✅ | client.Messages.NewStreaming (anthropic.go:100) |
| OpenAI Chat | ✅ SSE | ✅ | Chat.Completions.NewStreaming (openai.go:75) |
| OpenAI Responses | ✅ event stream | ✅ | Responses.NewStreaming (openairesponses.go:63) |
| Google Gemini | ✅ SSE | ✅ | chat.SendMessageStream (google.go:157) |
| Claude CLI | ✅ NDJSON via --output-format stream-json | ⚠️ | pi-go consumes the NDJSON but emits a single completed message rather than incremental events (claudecli/claude.go) |
| Codex CLI | ✅ JSONL via codex exec --json | ⚠️ | pi-go consumes JSONL item events and emits completed text/tool blocks rather than token deltas (codexcli/codex.go) |
Provider Documentation
- Anthropic — Streaming Messages
- OpenAI — Streaming Responses
- OpenAI Responses — Event types
- Google Gemini — Streaming generate
- Claude Code CLI —
--output-format stream-json - Codex CLI
pi-go Gaps
- Claude CLI does not emit per-delta events; full message is returned once. Streaming-style consumers see no progressive output.
- Codex CLI emits completed JSONL items; pi-go surfaces command and text items but not token-level deltas.
- No common heartbeat / keep-alive handling — long-running reasoning calls rely on the underlying SDK to keep the connection alive.