provider

package
v0.0.1-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package provider holds the concrete model adapters and adapter-only helpers.

After change 0018, every provider-neutral type (Request, Event, Message, Block, BlockKind, Role, ToolSchema, ToolCall, Usage, EventKind) and the Provider interface live in internal/ports — that is the canonical surface the core depends on. This package retains only what an adapter author needs: the anthropic and openaicompat backends, the prefix-select registry, and the shared SSE frame reader in this file. Core packages must not import here; internal/ports/leak_guard_test.go enforces that.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadSSE

func ReadSSE(ctx context.Context, r io.Reader) (<-chan SSEFrame, <-chan error)

ReadSSE reads Server-Sent Events from r, sending each decoded frame on the returned channel until r is exhausted, ctx is cancelled, or an error occurs. The channel is always closed on return. A frame is emitted on the blank line that terminates it, per the SSE spec.

Types

type SSEFrame

type SSEFrame struct {
	Event string
	Data  string
}

SSEFrame is one decoded "text/event-stream" frame: an optional event name and its (possibly multi-line) data payload, joined with "\n" per spec.

Directories

Path Synopsis
Package anthropic is the Anthropic Messages API adapter (ADR-0005, T-012).
Package anthropic is the Anthropic Messages API adapter (ADR-0005, T-012).
Package openaicompat is the OpenAI-compatible Chat Completions adapter (ADR-0005, T-013).
Package openaicompat is the OpenAI-compatible Chat Completions adapter (ADR-0005, T-013).
Package selectadapter is the adapter-selection composition layer (ADR-0005, T-014).
Package selectadapter is the adapter-selection composition layer (ADR-0005, T-014).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL