You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add streaming responses to LLM provider interface #44
Add streaming support to the llm.Provider interface so LLM responses are delivered incrementally instead of waiting for the full response.
Motivation
DocsClaw currently uses synchronous CompleteWithTools() which blocks until the entire response is ready. For a business agent producing long-form output (document summaries, report analysis), this creates poor UX — the user stares at a blank screen for seconds.
Pi-mono streams all responses with typed events (text_delta, toolcall_delta, thinking_delta), enabling progressive rendering. Both Anthropic and OpenAI APIs support streaming natively.
Update: OpenAI-compatible API as integration point
PR #55 added an OpenAI-compatible Chat Completions API (/v1/chat/completions) with SSE streaming. Currently it uses simulated streaming — the full response is obtained from the provider, then chunked word-by-word over SSE.
With true provider-level streaming, the OpenAI endpoint becomes the fourth consumer:
Updated integration points
Chat TUI: Bubble Tea model subscribes to stream, renders text deltas incrementally
A2A server: stream responses using A2A streaming protocol (SSE)
OpenAI-compatible API: pipe provider stream events directly into SSE chunks for real-time token delivery to Open WebUI and other clients
Agentic loop (pkg/tools/loop.go): collect stream to final Response for tool extraction, but emit text deltas for observability
Activity
pavelanni commentedon May 5, 2026
Update: OpenAI-compatible API as integration point
PR #55 added an OpenAI-compatible Chat Completions API (
/v1/chat/completions) with SSE streaming. Currently it uses simulated streaming — the full response is obtained from the provider, then chunked word-by-word over SSE.With true provider-level streaming, the OpenAI endpoint becomes the fourth consumer:
Updated integration points
pkg/tools/loop.go): collect stream to finalResponsefor tool extraction, but emit text deltas for observabilityAdd streaming responses to LLM provider interface (#57)