Versions in this module Expand all Collapse all v0 v0.2.1 Jul 24, 2026 v0.2.0 Jul 24, 2026 Changes in this version + func IsEncryptedReplayRejection(err error) bool + type ModelInfo struct + ContextWindow int + MaxOutputTokens int + func Lookup(model string) ModelInfo v0.1.0 Jul 6, 2026 Changes in this version + var ErrAuth = &ProviderError + var ErrCanceled = &ProviderError + var ErrContentFilter = &ProviderError + var ErrContextLength = &ProviderError + var ErrRateLimit = &ProviderError + var ErrUnsupported = &ProviderError + func UnsupportedStream(provider string) iter.Seq2[Chunk, error] + type Capabilities struct + Embeddings bool + Streaming bool + Tools bool + Vision bool + type Chunk struct + Done bool + FinishReason FinishReason + Reasoning *ReasoningPart + Text string + ToolCall *ToolCallPart + Usage Usage + type ContentPart interface + type ErrorKind string + const KindAuth + const KindCanceled + const KindContentFilter + const KindContextLength + const KindRateLimit + const KindUnknown + const KindUnsupported + type FinishReason string + const FinishContentFilter + const FinishLength + const FinishOther + const FinishStop + const FinishToolUse + type ImagePart struct + Data []byte + MIME string + URL string + func ImageData(mime string, data []byte) ImagePart + func ImageURL(url string) ImagePart + type Message struct + Parts []ContentPart + Role Role + func Assistant(s string) Message + func System(s string) Message + func ToolResultMsg(id, content string, isErr bool) Message + func User(s string) Message + func UserParts(parts ...ContentPart) Message + func (m *Message) UnmarshalJSON(data []byte) error + func (m Message) MarshalJSON() ([]byte, error) + func (m Message) Text() string + type Provider interface + Capabilities func() Capabilities + Generate func(ctx context.Context, req Request) (*Response, error) + Name func() string + Stream func(ctx context.Context, req Request) iter.Seq2[Chunk, error] + type ProviderError struct + Err error + Kind ErrorKind + Provider string + Retryable bool + StatusCode int + func (e *ProviderError) Error() string + func (e *ProviderError) Is(target error) bool + func (e *ProviderError) Unwrap() error + type ReasoningPart struct + Raw json.RawMessage + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Add(name string, p Provider) *Registry + func (r *Registry) All() []Provider + func (r *Registry) Get(name string) (Provider, bool) + func (r *Registry) MustGet(name string) Provider + func (r *Registry) Names() []string + type Request struct + MaxTokens int + Messages []Message + Model string + ProviderOptions map[string]any + ReasoningEffort string + Seed *int64 + StandingContext string + Stop []string + System string + Temperature *float64 + Tools []Tool + TopP *float64 + type Response struct + Content []ContentPart + FinishReason FinishReason + Model string + Raw any + Usage Usage + func (r *Response) Text() string + type Role string + const RoleAssistant + const RoleSystem + const RoleTool + const RoleUser + type TextPart struct + Text string + func Text(s string) TextPart + type Tool struct + Description string + Name string + Schema json.RawMessage + type ToolCallPart struct + Args json.RawMessage + ID string + Name string + type ToolResultPart struct + Content string + IsError bool + ToolCallID string + type Usage struct + CachedTokens int + CompletionTokens int + Cost float64 + PromptTokens int + ReasoningTokens int + TotalTokens int + func (u *Usage) UnmarshalJSON(data []byte) error