MCPcopy
hub / github.com/sipeed/picoclaw / StreamingProvider

Interface StreamingProvider

pkg/providers/types.go:45–54  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
45type 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
56type StreamingEventProvider interface {
57 ChatStreamEvents(

Callers

nothing calls this directly

Implementers 6

toolSchemaStreamingProviderpkg/providers/tool_schema_transform.go
Providerpkg/providers/bedrock/provider_stub.go
GeminiProviderpkg/providers/httpapi/gemini_provider.
HTTPProviderpkg/providers/httpapi/http_provider.go
Providerpkg/providers/openai_compat/provider.g
configuredStreamingProviderpkg/agent/pipeline_streaming_test.go

Calls

no outgoing calls

Tested by

no test coverage detected