Versions in this module Expand all Collapse all v0 v0.3.0 Oct 14, 2026 Changes in this version + const AnthropicModeBedrock + const AnthropicModeDirect + const GeminiModeAuto + const GeminiModeExpress + const GeminiModeStudio + const GeminiModeVertex + const SchemaPolicyBestEffort + const SchemaPolicyLossy + const SchemaPolicyStrict + var ErrProviderNotConfigured = errors.New("turnmeld: provider not configured") + var ErrSchemaIncompatible = schema.ErrSchemaIncompatible + var ErrStreamClosed = errors.New("turnmeld: stream closed") + var ErrUnknownModel = errors.New("turnmeld: unable to route model") + var ErrUnsupported = adapter.ErrUnsupported + func SetCacheControl(req *MessageNewParams, cc CacheControl) + type AnthropicConfig struct + APIKey string + BaseURL string + ExtraHeaders http.Header + Version string + type AnthropicMode = anthropicadapter.AnthropicMode + type AzureOpenAIConfig struct + APIKey string + APIVersion string + BaseURL string + Deployment string + ExtraHeaders http.Header + type BedrockConfig struct + AccessKeyID string + BaseURL string + ExtraHeaders http.Header + Region string + SecretAccessKey string + SessionToken string + type CacheControl struct + Type CacheControlType + func GetCacheControl(req MessageNewParams) (CacheControl, bool) + type CacheControlType string + const CacheControlEphemeral + type Client struct + func New(opts ...Option) (*Client, error) + func (c *Client) CreateMessage(ctx context.Context, req anthropic.MessageNewParams) (*anthropic.Message, error) + func (c *Client) CreateMessageStream(ctx context.Context, req anthropic.MessageNewParams) (*StreamReader, error) + type GeminiConfig struct + APIKey string + BaseURL string + ExtraHeaders http.Header + Location string + Mode GeminiMode + Project string + Publisher string + type GeminiMode = geminiadapter.GeminiMode + type Message = anthropic.Message + type MessageNewParams = anthropic.MessageNewParams + type MessageStreamEventUnion = anthropic.MessageStreamEventUnion + func DecodeEvent(data []byte) (MessageStreamEventUnion, error) + type OpenAICompatConfig struct + APIKey string + BaseURL string + DefaultModel string + ExtraHeaders http.Header + type OpenAIConfig = OpenAIResponsesConfig + type OpenAIResponsesConfig struct + APIKey string + BaseURL string + ExtraHeaders http.Header + Organization string + Project string + type Option func(*config) + func WithAnthropic(cfg AnthropicConfig) Option + func WithAnthropicBedrock(name string, cfg BedrockConfig) Option + func WithAnthropicCompat(name string, cfg AnthropicConfig) Option + func WithAzureOpenAI(name string, cfg AzureOpenAIConfig) Option + func WithChatCompletion(name string, cfg OpenAICompatConfig) Option + func WithGemini(cfg GeminiConfig) Option + func WithHTTPClient(h *http.Client) Option + func WithLogger(l *slog.Logger) Option + func WithModelOverride(fn func(model string) (Route, bool)) Option + func WithModelRoute(prefix string, route Route) Option + func WithOpenAI(cfg OpenAIResponsesConfig) Option + func WithOpenAIResponsesCompat(name string, cfg OpenAIResponsesConfig) Option + func WithSchemaPolicy(p SchemaPolicy) Option + type ProviderKind string + const ProviderAnthropic + const ProviderChatCompletions + const ProviderGeminiNative + const ProviderOpenAIResponses + type Route struct + Backend string + Provider ProviderKind + UpstreamModel string + type SchemaPolicy = schema.Policy + type StreamReader struct + func (s *StreamReader) Close() error + func (s *StreamReader) Current() MessageStreamEventUnion + func (s *StreamReader) CurrentRaw() []byte + func (s *StreamReader) Err() error + func (s *StreamReader) Next() bool