Versions in this module Expand all Collapse all v1 v1.0.0 Jul 24, 2026 Changes in this version + var ProviderIDs = []ProviderID + type AnthropicConfig struct + APIKey string + AnthropicVersion string + BaseURL string + DefaultMaxTokens int + Headers map[string]string + type AssistantMessage struct + Content string + Role ChatRole + ToolCalls []ToolCall + type BedrockConfig struct + AccessKeyID string + BaseURL string + DefaultMaxTokens int + Headers map[string]string + Region string + SecretAccessKey string + SessionToken string + type Chat struct + func NewChat(id ProviderID, cfg ChatConfig, opts ...Option) (*Chat, error) + func (c *Chat) Complete(ctx context.Context, in ChatInput) (*ChatResult, error) + func (c *Chat) ProviderID() ProviderID + func (c *Chat) Stream(ctx context.Context, in ChatInput) (*ChatStream, error) + type ChatConfig interface + type ChatInput struct + MaxOutputTokens *int + Messages []ChatMessage + Model string + Passthrough *Passthrough + Reasoning *ReasoningOptions + ResponseFormat *ResponseFormat + Stop []string + Temperature *float64 + ToolChoice *ToolChoice + Tools []ToolDefinition + TopP *float64 + type ChatMessage struct + Content string + ContentParts []ContentPart + Name string + Role ChatRole + ToolCallID string + ToolCalls []ToolCall + type ChatResult struct + FinishReason FinishReason + Message AssistantMessage + Model string + Raw any + Usage Usage + type ChatRole = string + type ChatStream struct + func (s *ChatStream) Close() error + func (s *ChatStream) Recv() (*ChatStreamDelta, error) + type ChatStreamDelta struct + ContentDelta string + FinishReason FinishReason + Raw any + ToolCallDelta *ToolCallDelta + Usage *Usage + type ConnectorError struct + Cause any + Message string + ProviderCode ProviderCode + ProviderMessage string + StatusCode *int + func (e *ConnectorError) Error() string + func (e *ConnectorError) Unwrap() error + type ContentPart struct + Base64 string + MediaType string + Text string + Type string + func ImagePart(base64, mediaType string) ContentPart + func TextPart(text string) ContentPart + type Embeddings struct + func NewEmbeddings(id ProviderID, cfg OpenAICompatConfig, opts ...Option) (*Embeddings, error) + func (e *Embeddings) Create(ctx context.Context, in EmbeddingsInput) (*EmbeddingsResult, error) + func (e *Embeddings) ProviderID() ProviderID + type EmbeddingsInput struct + Dimensions *int + Input []string + Model string + Passthrough *Passthrough + type EmbeddingsResult struct + Embeddings [][]float64 + Model string + Raw any + Usage EmbeddingsUsage + type EmbeddingsUsage struct + InputTokens int + TotalTokens int + type FinishReason = string + type GeminiConfig struct + APIKey string + BaseURL string + DefaultMaxTokens int + Headers map[string]string + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type OpenAICompatConfig struct + APIKey string + BaseURL string + Headers map[string]string + type Option func(*facadeOptions) + func WithHTTPClient(c HTTPClient) Option + type Passthrough struct + Body map[string]any + Headers map[string]string + Query map[string]string + type ProviderCode string + const CodeAuthFailed + const CodeContentFiltered + const CodeContextLengthExceeded + const CodeInvalidRequest + const CodeProviderUnavailable + const CodeRateLimited + const CodeUnknown + type ProviderID string + const Anthropic + const AzureOpenAI + const Bedrock + const Cloudflare + const DeepInfra + const DeepSeek + const Fireworks + const Gemini + const Groq + const LMStudio + const Mistral + const Ollama + const OpenAI + const OpenRouter + const Perplexity + const Together + const VLLM + const XAI + type ReasoningOptions struct + Effort string + type ResponseFormat struct + JSONSchema map[string]any + JSONSchemaName string + Type string + type ToolCall struct + Arguments string + ID string + Name string + type ToolCallDelta struct + ArgumentsDelta string + FunctionName string + ID string + Index int + type ToolChoice struct + FunctionName string + Mode string + type ToolDefinition struct + Description string + Name string + Parameters map[string]any + type Usage struct + InputTokens int + OutputTokens int + TotalTokens int