Documentation
¶
Overview ¶
Package responses implements the provider-neutral Responses API wire codec.
Index ¶
- func BuildRequestBody(req core.Request, dialect Dialect) ([]byte, error)
- func ConsumeStream(ctx context.Context, body io.Reader, ch chan<- core.AssistantEvent, ...)
- func ConsumeStreamSanitized(ctx context.Context, body io.Reader, ch chan<- core.AssistantEvent, ...)
- func MapReasoningEffort(level string, allowed []string) string
- func ParseTextSignature(sig string) (id, phase string)
- type Dialect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRequestBody ¶
BuildRequestBody encodes a stateless streaming Responses API request.
func ConsumeStream ¶
func ConsumeStream(ctx context.Context, body io.Reader, ch chan<- core.AssistantEvent, provider, model string)
consumeStream parses Responses API SSE and emits normalized AssistantEvents.
func ConsumeStreamSanitized ¶
func ConsumeStreamSanitized(ctx context.Context, body io.Reader, ch chan<- core.AssistantEvent, provider, model string)
ConsumeStreamSanitized parses a Responses stream without exposing upstream error messages. Private compatibility backends can echo request metadata in SSE errors, so their adapters use this stricter boundary.
func MapReasoningEffort ¶
mapReasoningEffort maps our thinking levels to OpenAI reasoning effort. OpenAI supports: none, minimal, low, medium, high, xhigh.
func ParseTextSignature ¶
parseTextSignature decodes a TextSignature blob back into id/phase. Tolerates empty/legacy values.
Types ¶
type Dialect ¶
type Dialect struct {
Provider string
Model string
SupportsDocuments bool
SupportsMaxOutputTokens bool
SupportsParallelToolCalls bool
AllowedReasoningEfforts []string
}
Dialect describes the validated Responses API capabilities of a transport. It intentionally contains protocol features only; URLs, credentials and retry policies stay in the owning provider.