Versions in this module Expand all Collapse all v0 v0.1.0 Oct 28, 2026 Changes in this version + const Assistant + const StopEnd + const StopLength + const StopOther + const StopRefused + const User + var Providers = []Provider + type Chunk struct + Text string + type Client interface + Complete func(ctx context.Context, r Request) (Response, error) + Provider func() Provider + Stream func(ctx context.Context, r Request, emit func(Chunk) error) (Response, error) + func New(c Config) (Client, error) + type Config struct + APIKey string + BaseURL string + HTTPClient *http.Client + Model string + Provider Provider + type Error struct + Kind Kind + Message string + Provider Provider + Status int + func (e *Error) Error() string + func (e *Error) Is(target error) bool + type Kind string + const ErrAuth + const ErrBadRequest + const ErrCanceled + const ErrInternal + const ErrRateLimit + const ErrTooLarge + const ErrUnavailable + type Message struct + Role string + Text string + type Provider string + const Anthropic + const Gemini + const OpenAI + const OpenRouter + func (p Provider) Valid() bool + type Request struct + MaxTokens int + Messages []Message + System string + Temperature *float64 + func (r Request) Check() error + type Response struct + Model string + Stop string + Text string + Usage Usage + type Usage struct + Input int + Output int