StreamingProvider is an optional interface for providers that support token streaming. onChunk receives the accumulated text so far (not individual deltas). The returned LLMResponse is the same complete response for compatibility with tool-call handling.
| 43 | // onChunk receives the accumulated text so far (not individual deltas). |
| 44 | // The returned LLMResponse is the same complete response for compatibility with tool-call handling. |
| 45 | type StreamingProvider interface { |
| 46 | ChatStream( |
| 47 | ctx context.Context, |
| 48 | messages []Message, |
| 49 | tools []ToolDefinition, |
| 50 | model string, |
| 51 | options map[string]any, |
| 52 | onChunk func(accumulated string), |
| 53 | ) (*LLMResponse, error) |
| 54 | } |
| 55 | |
| 56 | type StreamingEventProvider interface { |
| 57 | ChatStreamEvents( |
nothing calls this directly
no outgoing calls
no test coverage detected