Documentation
¶
Index ¶
- Constants
- Variables
- func AWSCanonicalURI(uri string) string
- func AWSSigningKey(secret, dateStamp, region, service string) []byte
- func AnthropicBaseFromOpenAIV1(openAIBase string) string
- func AudioFormatToMediaType(format string) string
- func BuildAnthropicCachedRequest(messages []core.GraycodeRouterMessage, model string, maxTokens int, ...) map[string]interface{}
- func BuildAnthropicMessages(messages []core.GraycodeRouterMessage) ([]map[string]interface{}, string)
- func CanonicalAWSHeaders(headers http.Header) (string, string)
- func ConvertToAnthropicTools(tools []core.GraycodeRouterTool) []anthropicTool
- func DetectProvider() string
- func DynamicProviderEnabled() bool
- func FreezeRegistry()
- func OACompatUnsupportedError(err error) bool
- func OpenAIBaseFallbackURL() string
- func OpenAIToolChoice(tc *core.ToolChoiceOption) interface{}
- func ParseAnthropicResponse(ar anthropicResponse, requestID, orgID string) *core.GraycodeRouterResponse
- func ProcessGeminiStream(ctx context.Context, events <-chan core.SSEEvent, logger *slog.Logger) <-chan core.GraycodeRouterStreamEvent
- func RegisterDynamicProvider(name, baseURL, envKey string) error
- func ResolveEnvSecret(envKey string) string
- func ResolveProviderModelEnvOverride(provider string) string
- func Sha256Hex(data []byte) string
- func ThinkingForBudget(budget int) *anthropicThinking
- type AgnesClient
- func (c *AgnesClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *AgnesClient) Name() string
- func (c *AgnesClient) Ping(ctx context.Context) error
- func (c *AgnesClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type AnthropicClient
- func (c *AnthropicClient) BaseURL() string
- func (c *AnthropicClient) BuildAnthropicRequest(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*http.Request, []byte, error)
- func (c *AnthropicClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *AnthropicClient) CountTokens(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*TokenCountResult, error)
- func (c *AnthropicClient) DefaultMaxTokens() int
- func (c *AnthropicClient) DefaultModel() string
- func (c *AnthropicClient) DefaultTemperature() *float64
- func (c *AnthropicClient) Guardrails() *core.Guardrails
- func (c *AnthropicClient) HTTPClient() *http.Client
- func (c *AnthropicClient) Logger() *slog.Logger
- func (c *AnthropicClient) Name() string
- func (c *AnthropicClient) Ping(ctx context.Context) error
- func (c *AnthropicClient) Retry() core.RetryConfig
- func (c *AnthropicClient) SetAPIKey(key string)
- func (c *AnthropicClient) SetBaseURL(url string)
- func (c *AnthropicClient) SetDefaultMaxTokens(n int)
- func (c *AnthropicClient) SetDefaultModel(model string)
- func (c *AnthropicClient) SetDefaultTemperature(t float64)
- func (c *AnthropicClient) SetGuardrails(g *core.Guardrails)
- func (c *AnthropicClient) SetHTTPClient(hc *http.Client)
- func (c *AnthropicClient) SetLogger(l *slog.Logger)
- func (c *AnthropicClient) SetMimoAuth()
- func (c *AnthropicClient) SetProviderName(string)
- func (c *AnthropicClient) SetRetry(rc core.RetryConfig)
- func (c *AnthropicClient) SetTimeout(d time.Duration)
- func (c *AnthropicClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- func (c *AnthropicClient) Version() string
- type AnthropicMetadata
- type AnthropicOutputConfig
- type AnthropicOutputFormat
- type AnthropicRequest
- type AnthropicResponse
- type AnthropicThinking
- type AnthropicTool
- type AnthropicToolChoice
- type AzureClient
- func (c *AzureClient) APIVersion() string
- func (c *AzureClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *AzureClient) Endpoint() string
- func (c *AzureClient) Name() string
- func (c *AzureClient) Ping(ctx context.Context) error
- func (c *AzureClient) SetHTTPClient(hc *http.Client)
- func (c *AzureClient) SetRetry(rc core.RetryConfig)
- func (c *AzureClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type BedrockClient
- func (c *BedrockClient) BuildBody(messages []core.GraycodeRouterMessage, opts core.ChatOptions) ([]byte, error)
- func (c *BedrockClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *BedrockClient) HTTPClient() *http.Client
- func (c *BedrockClient) ModelURL(model string) string
- func (c *BedrockClient) Name() string
- func (c *BedrockClient) Ping(ctx context.Context) error
- func (c *BedrockClient) Region() string
- func (c *BedrockClient) Retry() core.RetryConfig
- func (c *BedrockClient) SetHTTPClient(hc *http.Client)
- func (c *BedrockClient) SetRetry(rc core.RetryConfig)
- func (c *BedrockClient) Sign(req *http.Request, body []byte, now time.Time) error
- func (c *BedrockClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- func (c *BedrockClient) String() string
- type CanopyWaveClient
- func (c *CanopyWaveClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *CanopyWaveClient) Name() string
- func (c *CanopyWaveClient) Ping(ctx context.Context) error
- func (c *CanopyWaveClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type ChatProtocol
- type ClinePassClient
- func (c *ClinePassClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *ClinePassClient) Name() string
- func (c *ClinePassClient) Ping(ctx context.Context) error
- func (c *ClinePassClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type ConcentrateResponsesClient
- func (c *ConcentrateResponsesClient) BaseURL() string
- func (c *ConcentrateResponsesClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *ConcentrateResponsesClient) DefaultMaxTokens() int
- func (c *ConcentrateResponsesClient) DefaultModel() string
- func (c *ConcentrateResponsesClient) DefaultTemperature() *float64
- func (c *ConcentrateResponsesClient) Guardrails() *core.Guardrails
- func (c *ConcentrateResponsesClient) HTTPClient() *http.Client
- func (c *ConcentrateResponsesClient) Logger() *slog.Logger
- func (c *ConcentrateResponsesClient) Name() string
- func (c *ConcentrateResponsesClient) Ping(ctx context.Context) error
- func (c *ConcentrateResponsesClient) Retry() core.RetryConfig
- func (c *ConcentrateResponsesClient) SetAPIKey(key string)
- func (c *ConcentrateResponsesClient) SetBaseURL(url string)
- func (c *ConcentrateResponsesClient) SetDefaultMaxTokens(n int)
- func (c *ConcentrateResponsesClient) SetDefaultModel(model string)
- func (c *ConcentrateResponsesClient) SetDefaultTemperature(t float64)
- func (c *ConcentrateResponsesClient) SetGuardrails(g *core.Guardrails)
- func (c *ConcentrateResponsesClient) SetHTTPClient(hc *http.Client)
- func (c *ConcentrateResponsesClient) SetLogger(l *slog.Logger)
- func (c *ConcentrateResponsesClient) SetMimoAuth()
- func (c *ConcentrateResponsesClient) SetProviderName(string)
- func (c *ConcentrateResponsesClient) SetRetry(rc core.RetryConfig)
- func (c *ConcentrateResponsesClient) SetTimeout(d time.Duration)
- func (c *ConcentrateResponsesClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- func (c *ConcentrateResponsesClient) Version() string
- type DeepSeekClient
- func (c *DeepSeekClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *DeepSeekClient) Name() string
- func (c *DeepSeekClient) Ping(ctx context.Context) error
- func (c *DeepSeekClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type GeminiClient
- func (c *GeminiClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *GeminiClient) HTTPClient() *http.Client
- func (c *GeminiClient) Name() string
- func (c *GeminiClient) Ping(ctx context.Context) error
- func (c *GeminiClient) Retry() core.RetryConfig
- func (c *GeminiClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type GeminiOpenAIClient
- func (c *GeminiOpenAIClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *GeminiOpenAIClient) Name() string
- func (c *GeminiOpenAIClient) Ping(ctx context.Context) error
- func (c *GeminiOpenAIClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type GrokClient
- func (c *GrokClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *GrokClient) Name() string
- func (c *GrokClient) Ping(ctx context.Context) error
- func (c *GrokClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type GroqClient
- func (c *GroqClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *GroqClient) Name() string
- func (c *GroqClient) Ping(ctx context.Context) error
- func (c *GroqClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type KimiClient
- func (c *KimiClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *KimiClient) Name() string
- func (c *KimiClient) Ping(ctx context.Context) error
- func (c *KimiClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type LongCatClient
- func (c *LongCatClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *LongCatClient) Name() string
- func (c *LongCatClient) Ping(ctx context.Context) error
- func (c *LongCatClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type MiMoClient
- func (c *MiMoClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *MiMoClient) Name() string
- func (c *MiMoClient) Ping(ctx context.Context) error
- func (c *MiMoClient) ProviderID() string
- func (c *MiMoClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type MiniMaxClient
- func (c *MiniMaxClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *MiniMaxClient) Name() string
- func (c *MiniMaxClient) Ping(ctx context.Context) error
- func (c *MiniMaxClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type OllamaClient
- func (c *OllamaClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *OllamaClient) Name() string
- func (c *OllamaClient) Ping(ctx context.Context) error
- func (c *OllamaClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type OpenAIClient
- func (c *OpenAIClient) BaseURL() string
- func (c *OpenAIClient) BuildOpenAIRequest(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*http.Request, []byte, error)
- func (c *OpenAIClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *OpenAIClient) Compat() *OpenAICompatConfig
- func (c *OpenAIClient) CreateEmbedding(ctx context.Context, req core.EmbeddingRequest) (*core.EmbeddingResponse, error)
- func (c *OpenAIClient) DefaultMaxTokens() int
- func (c *OpenAIClient) DefaultModel() string
- func (c *OpenAIClient) DefaultTemperature() *float64
- func (c *OpenAIClient) Guardrails() *core.Guardrails
- func (c *OpenAIClient) HTTPClient() *http.Client
- func (c *OpenAIClient) Logger() *slog.Logger
- func (c *OpenAIClient) Name() string
- func (c *OpenAIClient) Ping(ctx context.Context) error
- func (c *OpenAIClient) ProviderName() string
- func (c *OpenAIClient) Retry() core.RetryConfig
- func (c *OpenAIClient) SetAPIKey(key string)
- func (c *OpenAIClient) SetBaseURL(url string)
- func (c *OpenAIClient) SetDefaultMaxTokens(n int)
- func (c *OpenAIClient) SetDefaultModel(model string)
- func (c *OpenAIClient) SetDefaultTemperature(t float64)
- func (c *OpenAIClient) SetGuardrails(g *core.Guardrails)
- func (c *OpenAIClient) SetHTTPClient(hc *http.Client)
- func (c *OpenAIClient) SetLogger(l *slog.Logger)
- func (c *OpenAIClient) SetMimoAuth()
- func (c *OpenAIClient) SetProviderName(name string)
- func (c *OpenAIClient) SetRetry(rc core.RetryConfig)
- func (c *OpenAIClient) SetTimeout(d time.Duration)
- func (c *OpenAIClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type OpenAICompatConfig
- type OpenAIEmbeddingData
- type OpenAIEmbeddingResponse
- type OpenAIEmbeddingUsage
- type OpenAIRequest
- type OpenAIResponse
- type OpenCodeGoClient
- func (c *OpenCodeGoClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *OpenCodeGoClient) Name() string
- func (c *OpenCodeGoClient) Ping(ctx context.Context) error
- func (c *OpenCodeGoClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type OpenGatewayClient
- func (c *OpenGatewayClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *OpenGatewayClient) Name() string
- func (c *OpenGatewayClient) Ping(ctx context.Context) error
- func (c *OpenGatewayClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type OpenRouterClient
- func (c *OpenRouterClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *OpenRouterClient) Name() string
- func (c *OpenRouterClient) Ping(ctx context.Context) error
- func (c *OpenRouterClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type PoolsideClient
- func (c *PoolsideClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *PoolsideClient) Name() string
- func (c *PoolsideClient) Ping(ctx context.Context) error
- func (c *PoolsideClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type ProtocolChatFallback
- type ProtocolRouter
- type ProtocolStreamConfig
- type ProviderRegistryConfig
- type ProviderType
- type StepFunClient
- func (c *StepFunClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *StepFunClient) Name() string
- func (c *StepFunClient) Ping(ctx context.Context) error
- func (c *StepFunClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type TokenCountResult
- type VertexClient
- func (c *VertexClient) BaseURL() string
- func (c *VertexClient) BuildBody(messages []core.GraycodeRouterMessage, opts core.ChatOptions, stream bool) ([]byte, error)
- func (c *VertexClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *VertexClient) HTTPClient() *http.Client
- func (c *VertexClient) Name() string
- func (c *VertexClient) Ping(ctx context.Context) error
- func (c *VertexClient) ProjectID() string
- func (c *VertexClient) Region() string
- func (c *VertexClient) SetHTTPClient(hc *http.Client)
- func (c *VertexClient) SetRetry(rc core.RetryConfig)
- func (c *VertexClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
- type ZAIClient
- func (c *ZAIClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.GraycodeRouterResponse, error)
- func (c *ZAIClient) Name() string
- func (c *ZAIClient) Ping(ctx context.Context) error
- func (c *ZAIClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, ...) (*core.StreamResult, error)
Constants ¶
const DynamicProviderEnvVar = "GRAYCODE_ROUTER_ALLOW_DYNAMIC_PROVIDERS"
DynamicProviderEnvVar is the opt-in env var that allows graycode-router to auto-register an OpenAI-compatible provider from OPENAI_API_BASE / OPENAI_BASE_URL when an unknown provider name is requested.
GeminiSharedParserEnvVar controls the shared SSE parser compatibility switch.
Variables ¶
var ( OpenAICompat = OpenAICompatConfig{ SupportsStore: true, SupportsDeveloperRole: true, SupportsReasoningEffort: true, SupportsUsageInStreaming: true, MaxTokensField: "max_completion_tokens", } GrokCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } OpenRouterCompat = OpenAICompatConfig{ ThinkingFormat: "openrouter", MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, } GeminiCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, } ZAICompat = OpenAICompatConfig{ ThinkingFormat: "zai", MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, } CanopyWaveCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } OpenGatewayCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, } OllamaCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } OpenCodeGoCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, ThinkingFormat: "openrouter", } PoolsideCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } GroqCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } ClinePassCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } KimiCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", SupportsCacheRole: true, ThinkingFormat: "kimi", DefaultDisableThinking: true, } XiaomiCompat = OpenAICompatConfig{ MaxTokensField: "max_completion_tokens", ThinkingFormat: "xiaomi", DefaultDisableThinking: true, } AzureCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } BedrockCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } VertexCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } // AgnesCompat: OpenAI-compatible; pre-authorizes max token cost, so omit max_tokens. AgnesCompat = OpenAICompatConfig{ OmitMaxTokens: true, ThinkingFormat: "agnes", } // LongCatCompat: OpenAI-compatible; enables thinking by default, so disable it. LongCatCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", ThinkingFormat: "longcat", DefaultDisableThinking: true, } // MiniMaxCompat: OpenAI-compatible; enables thinking by default, so disable it. MiniMaxCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", ThinkingFormat: "minimax", DefaultDisableThinking: true, } // DeepSeekCompat: OpenAI-compatible with usage in streaming. // DeepSeek requires the assistant's reasoning_content to be passed back whenever // that turn performed a tool call (HTTP 400 otherwise), so we forward it. // Enables thinking by default, so disable it. DeepSeekCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, RequiresReasoningPassback: true, ThinkingFormat: "deepseek", DefaultDisableThinking: true, } ConcentrateCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", SupportsUsageInStreaming: true, } StepFunCompat = OpenAICompatConfig{ MaxTokensField: "max_tokens", } )
Per-provider compat configs.
var CoreProviders, OpenAICompatibleProviders = staticProviderMaps()
CoreProviders and OpenAICompatibleProviders are derived from the canonical catalog registry. Dynamic providers are added only to the compatible map.
var DynamicMu sync.RWMutex
DynamicMu protects the OpenAICompatibleProviders map from concurrent access.
Functions ¶
func AWSCanonicalURI ¶
AWSCanonicalURI returns the canonical URI used by SigV4.
func AWSSigningKey ¶
AWSSigningKey derives a SigV4 signing key from explicit inputs.
func AnthropicBaseFromOpenAIV1 ¶
AnthropicBaseFromOpenAIV1 strips a trailing /v1 from an OpenAI-compatible base URL. OpenCode Go Anthropic models share the host without the /v1 suffix.
func AudioFormatToMediaType ¶
func BuildAnthropicCachedRequest ¶
func BuildAnthropicCachedRequest(messages []core.GraycodeRouterMessage, model string, maxTokens int, temperature *float64, stream bool, tools []AnthropicTool, thinking *AnthropicThinking, toolChoice *AnthropicToolChoice, topP *float64, topK *int, stopSequences []string, ) map[string]interface{}
BuildAnthropicCachedRequest creates an Anthropic request with cache breakpoints.
func BuildAnthropicMessages ¶
func BuildAnthropicMessages(messages []core.GraycodeRouterMessage) ([]map[string]interface{}, string)
func CanonicalAWSHeaders ¶
CanonicalAWSHeaders canonicalizes a header set for SigV4.
func ConvertToAnthropicTools ¶
func ConvertToAnthropicTools(tools []core.GraycodeRouterTool) []anthropicTool
func DetectProvider ¶
func DetectProvider() string
DetectProvider detects the active provider from the credential store (not process env).
func DynamicProviderEnabled ¶
func DynamicProviderEnabled() bool
DynamicProviderEnabled reports whether callers may auto-register an OpenAI-compatible provider from OPENAI_API_BASE / OPENAI_BASE_URL when an unknown provider name is requested.
func OACompatUnsupportedError ¶
OACompatUnsupportedError reports whether an error indicates OA-compat is unsupported.
func OpenAIBaseFallbackURL ¶
func OpenAIBaseFallbackURL() string
OpenAIBaseFallbackURL returns the OPENAI_API_BASE or OPENAI_BASE_URL env var.
func OpenAIToolChoice ¶
func OpenAIToolChoice(tc *core.ToolChoiceOption) interface{}
OpenAIToolChoice converts the public tool-choice contract to wire form.
func ParseAnthropicResponse ¶
func ParseAnthropicResponse(ar anthropicResponse, requestID, orgID string) *core.GraycodeRouterResponse
ParseAnthropicResponse converts a parsed Anthropic Messages API response into an core.GraycodeRouterResponse. Shared by Anthropic, Bedrock, and Vertex clients (all three receive the same wire format).
Content blocks are extracted per type:
- "text" → Content (concatenated)
- "thinking" → Thinking (concatenated)
- "redacted_thinking" → skipped silently (safety-sensitive reasoning)
- "tool_use" → appended to ToolCalls with parsed Arguments
requestID is required. orgID is the Anthropic-Organization-Id response header (Anthropic-specific; Bedrock and Vertex pass "").
func ProcessGeminiStream ¶
func ProcessGeminiStream(ctx context.Context, events <-chan core.SSEEvent, logger *slog.Logger) <-chan core.GraycodeRouterStreamEvent
ProcessGeminiStream normalizes decoded Gemini SSE events.
func RegisterDynamicProvider ¶
RegisterDynamicProvider adds a user-defined OpenAI-compatible provider at runtime.
func ResolveEnvSecret ¶
ResolveEnvSecret looks up an environment variable via the credential store with a bounded timeout.
func ResolveProviderModelEnvOverride ¶
ResolveProviderModelEnvOverride resolves the model env override for a provider.
func ThinkingForBudget ¶
func ThinkingForBudget(budget int) *anthropicThinking
ThinkingForBudget builds the wire-level extended-thinking configuration.
Types ¶
type AgnesClient ¶
type AgnesClient struct {
// contains filtered or unexported fields
}
AgnesClient uses the OpenAI-compatible Agnes AI endpoint. Official docs expose an OpenAI-compatible API only.
func NewAgnesClient ¶
func NewAgnesClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *AgnesClient
NewAgnesClient builds an Agnes AI provider client. openAIBase is typically "https://apihub.agnes-ai.com/v1".
func (*AgnesClient) Chat ¶
func (c *AgnesClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*AgnesClient) Name ¶
func (c *AgnesClient) Name() string
func (*AgnesClient) StreamChat ¶
func (c *AgnesClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type AnthropicClient ¶
type AnthropicClient struct {
// contains filtered or unexported fields
}
AnthropicClient implements core.Provider for the Anthropic Messages API.
func NewAnthropicClient ¶
func NewAnthropicClient(apiKey, baseURL string, opts ...core.ClientOption) *AnthropicClient
NewAnthropicClient creates a configured Anthropic client.
func (*AnthropicClient) BaseURL ¶
func (c *AnthropicClient) BaseURL() string
func (*AnthropicClient) BuildAnthropicRequest ¶
func (c *AnthropicClient) BuildAnthropicRequest(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions, stream bool) (*http.Request, []byte, error)
BuildAnthropicRequest constructs a complete Anthropic Messages request.
func (*AnthropicClient) Chat ¶
func (c *AnthropicClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
Anthropic structured output is sent through output_config.format. A schema-less json_object request is rejected instead of being silently ignored because Anthropic requires a JSON schema.
func (*AnthropicClient) CountTokens ¶
func (c *AnthropicClient) CountTokens(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*TokenCountResult, error)
CountTokens counts the number of tokens in a message without generating a response. Uses the same request format as Chat but hits the /v1/messages/count_tokens endpoint. The request body includes model, messages, system, and tools (but not max_tokens or stream).
func (*AnthropicClient) DefaultMaxTokens ¶
func (c *AnthropicClient) DefaultMaxTokens() int
func (*AnthropicClient) DefaultModel ¶
func (c *AnthropicClient) DefaultModel() string
func (*AnthropicClient) DefaultTemperature ¶
func (c *AnthropicClient) DefaultTemperature() *float64
func (*AnthropicClient) Guardrails ¶
func (c *AnthropicClient) Guardrails() *core.Guardrails
func (*AnthropicClient) HTTPClient ¶
func (c *AnthropicClient) HTTPClient() *http.Client
func (*AnthropicClient) Logger ¶
func (c *AnthropicClient) Logger() *slog.Logger
func (*AnthropicClient) Name ¶
func (c *AnthropicClient) Name() string
Name returns the provider name.
func (*AnthropicClient) Ping ¶
func (c *AnthropicClient) Ping(ctx context.Context) error
Ping checks connectivity to the Anthropic API using a lightweight GET request.
func (*AnthropicClient) Retry ¶
func (c *AnthropicClient) Retry() core.RetryConfig
func (*AnthropicClient) SetAPIKey ¶
func (c *AnthropicClient) SetAPIKey(key string)
SetAPIKey sets the API key.
func (*AnthropicClient) SetBaseURL ¶
func (c *AnthropicClient) SetBaseURL(url string)
SetBaseURL sets the base URL.
func (*AnthropicClient) SetDefaultMaxTokens ¶
func (c *AnthropicClient) SetDefaultMaxTokens(n int)
SetDefaultMaxTokens sets the default max tokens for requests.
func (*AnthropicClient) SetDefaultModel ¶
func (c *AnthropicClient) SetDefaultModel(model string)
SetDefaultModel sets the default model for requests.
func (*AnthropicClient) SetDefaultTemperature ¶
func (c *AnthropicClient) SetDefaultTemperature(t float64)
SetDefaultTemperature sets the default temperature for requests.
func (*AnthropicClient) SetGuardrails ¶
func (c *AnthropicClient) SetGuardrails(g *core.Guardrails)
SetGuardrails attaches output guardrails.
func (*AnthropicClient) SetHTTPClient ¶
func (c *AnthropicClient) SetHTTPClient(hc *http.Client)
SetHTTPClient replaces the HTTP client.
func (*AnthropicClient) SetLogger ¶
func (c *AnthropicClient) SetLogger(l *slog.Logger)
SetLogger sets the logger.
func (*AnthropicClient) SetMimoAuth ¶
func (c *AnthropicClient) SetMimoAuth()
SetMimoAuth switches authentication to MiMo's api-key header.
func (*AnthropicClient) SetProviderName ¶
func (c *AnthropicClient) SetProviderName(string)
SetProviderName is a no-op: the Anthropic adapter reports a fixed provider name. Present to satisfy core.Configurable; core.WithProviderName only affects OpenAI-compatible adapters.
func (*AnthropicClient) SetRetry ¶
func (c *AnthropicClient) SetRetry(rc core.RetryConfig)
SetRetry sets the retry configuration.
func (*AnthropicClient) SetTimeout ¶
func (c *AnthropicClient) SetTimeout(d time.Duration)
SetTimeout sets the HTTP client timeout.
func (*AnthropicClient) StreamChat ¶
func (c *AnthropicClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
StreamChat sends a streaming message to Anthropic.
func (*AnthropicClient) Version ¶
func (c *AnthropicClient) Version() string
type AnthropicMetadata ¶
type AnthropicMetadata = anthropicMetadata
type AnthropicOutputConfig ¶
type AnthropicOutputConfig = anthropicOutputConfig
func ResolveOutputConfig ¶
func ResolveOutputConfig(opts core.ChatOptions) *AnthropicOutputConfig
type AnthropicOutputFormat ¶
type AnthropicOutputFormat = anthropicOutputFormat
type AnthropicRequest ¶
type AnthropicRequest = anthropicRequest
type AnthropicResponse ¶
type AnthropicResponse = anthropicResponse
type AnthropicThinking ¶
type AnthropicThinking = anthropicThinking
func ResolveThinking ¶
func ResolveThinking(opts core.ChatOptions) *AnthropicThinking
type AnthropicTool ¶
type AnthropicTool = anthropicTool
type AnthropicToolChoice ¶
type AnthropicToolChoice = anthropicToolChoice
func ResolveToolChoice ¶
func ResolveToolChoice(tc *core.ToolChoiceOption) *AnthropicToolChoice
type AzureClient ¶
type AzureClient struct {
// contains filtered or unexported fields
}
func NewAzureClient ¶
func NewAzureClient(apiKey, endpoint, apiVersion string) *AzureClient
func (*AzureClient) APIVersion ¶
func (c *AzureClient) APIVersion() string
APIVersion returns the API version.
func (*AzureClient) Chat ¶
func (c *AzureClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*AzureClient) Endpoint ¶
func (c *AzureClient) Endpoint() string
Endpoint returns the base endpoint.
func (*AzureClient) Name ¶
func (c *AzureClient) Name() string
func (*AzureClient) SetHTTPClient ¶
func (c *AzureClient) SetHTTPClient(hc *http.Client)
SetHTTPClient replaces the transport used for Azure requests.
func (*AzureClient) SetRetry ¶
func (c *AzureClient) SetRetry(rc core.RetryConfig)
SetRetry configures provider retry behavior.
func (*AzureClient) StreamChat ¶
func (c *AzureClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type BedrockClient ¶
type BedrockClient struct {
// contains filtered or unexported fields
}
func NewBedrockClient ¶
func NewBedrockClient(accessKeyID, secretAccessKey, sessionToken, region string) *BedrockClient
func (*BedrockClient) BuildBody ¶
func (c *BedrockClient) BuildBody(messages []core.GraycodeRouterMessage, opts core.ChatOptions) ([]byte, error)
BuildBody creates the Anthropic-compatible Bedrock request payload.
func (*BedrockClient) Chat ¶
func (c *BedrockClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*BedrockClient) HTTPClient ¶
func (c *BedrockClient) HTTPClient() *http.Client
HTTPClient returns the underlying HTTP client.
func (*BedrockClient) ModelURL ¶
func (c *BedrockClient) ModelURL(model string) string
ModelURL returns the signed model URL for Bedrock.
func (*BedrockClient) Name ¶
func (c *BedrockClient) Name() string
func (*BedrockClient) Region ¶
func (c *BedrockClient) Region() string
Region returns the AWS region.
func (*BedrockClient) Retry ¶
func (c *BedrockClient) Retry() core.RetryConfig
Retry returns the retry configuration.
func (*BedrockClient) SetHTTPClient ¶
func (c *BedrockClient) SetHTTPClient(hc *http.Client)
func (*BedrockClient) SetRetry ¶
func (c *BedrockClient) SetRetry(rc core.RetryConfig)
func (*BedrockClient) StreamChat ¶
func (c *BedrockClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
func (*BedrockClient) String ¶
func (c *BedrockClient) String() string
String returns a safe string representation of the Bedrock client. Sensitive fields (secret access key) are masked to prevent accidental exposure in logs.
type CanopyWaveClient ¶
type CanopyWaveClient struct {
// contains filtered or unexported fields
}
CanopyWaveClient uses the OpenAI-compatible CanopyWave endpoint.
func NewCanopyWaveClient ¶
func NewCanopyWaveClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *CanopyWaveClient
NewCanopyWaveClient builds a CanopyWave provider client. openAIBase is typically "https://inference.canopywave.io/v1".
func (*CanopyWaveClient) Chat ¶
func (c *CanopyWaveClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*CanopyWaveClient) Name ¶
func (c *CanopyWaveClient) Name() string
func (*CanopyWaveClient) StreamChat ¶
func (c *CanopyWaveClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type ChatProtocol ¶
type ChatProtocol int
ChatProtocol selects which existing graycode-router client handles a gateway request.
const ( // ChatProtocolCompletions routes via OpenAIClient (POST /v1/chat/completions). ChatProtocolCompletions ChatProtocol = iota // ChatProtocolMessages routes via AnthropicClient (POST /v1/messages). ChatProtocolMessages )
type ClinePassClient ¶
type ClinePassClient struct {
// contains filtered or unexported fields
}
ClinePassClient uses the OpenAI-compatible ClinePass endpoint.
func NewClinePassClient ¶
func NewClinePassClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *ClinePassClient
NewClinePassClient builds a ClinePass provider client. openAIBase is typically "https://api.cline.bot/api/v1".
func (*ClinePassClient) Chat ¶
func (c *ClinePassClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*ClinePassClient) Name ¶
func (c *ClinePassClient) Name() string
func (*ClinePassClient) StreamChat ¶
func (c *ClinePassClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type ConcentrateResponsesClient ¶
type ConcentrateResponsesClient struct {
// contains filtered or unexported fields
}
ConcentrateResponsesClient uses the Concentrate Responses API (the production-ready API per Concentrate docs). This is the recommended adapter for Concentrate AI.
The Responses API uses /v1/responses endpoint with a unified format that works across all models (OpenAI, Anthropic, Google, etc.).
func NewConcentrateResponsesClient ¶
func NewConcentrateResponsesClient(apiKey, baseURL string, opts ...core.ClientOption) *ConcentrateResponsesClient
NewConcentrateResponsesClient builds a Concentrate AI provider client using the Responses API. baseURL is typically "https://api.concentrate.ai/v1".
func (*ConcentrateResponsesClient) BaseURL ¶
func (c *ConcentrateResponsesClient) BaseURL() string
BaseURL implements core.Configurable.
func (*ConcentrateResponsesClient) Chat ¶
func (c *ConcentrateResponsesClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
Chat implements core.Provider using the Responses API.
func (*ConcentrateResponsesClient) DefaultMaxTokens ¶
func (c *ConcentrateResponsesClient) DefaultMaxTokens() int
DefaultMaxTokens implements core.Configurable.
func (*ConcentrateResponsesClient) DefaultModel ¶
func (c *ConcentrateResponsesClient) DefaultModel() string
DefaultModel implements core.Configurable.
func (*ConcentrateResponsesClient) DefaultTemperature ¶
func (c *ConcentrateResponsesClient) DefaultTemperature() *float64
DefaultTemperature implements core.Configurable.
func (*ConcentrateResponsesClient) Guardrails ¶
func (c *ConcentrateResponsesClient) Guardrails() *core.Guardrails
Guardrails implements core.Configurable.
func (*ConcentrateResponsesClient) HTTPClient ¶
func (c *ConcentrateResponsesClient) HTTPClient() *http.Client
HTTPClient implements core.Configurable.
func (*ConcentrateResponsesClient) Logger ¶
func (c *ConcentrateResponsesClient) Logger() *slog.Logger
Logger implements core.Configurable.
func (*ConcentrateResponsesClient) Name ¶
func (c *ConcentrateResponsesClient) Name() string
func (*ConcentrateResponsesClient) Ping ¶
func (c *ConcentrateResponsesClient) Ping(ctx context.Context) error
Ping checks the health of the Concentrate API.
func (*ConcentrateResponsesClient) Retry ¶
func (c *ConcentrateResponsesClient) Retry() core.RetryConfig
Retry implements core.Configurable.
func (*ConcentrateResponsesClient) SetAPIKey ¶
func (c *ConcentrateResponsesClient) SetAPIKey(key string)
SetAPIKey implements core.Configurable.
func (*ConcentrateResponsesClient) SetBaseURL ¶
func (c *ConcentrateResponsesClient) SetBaseURL(url string)
SetBaseURL implements core.Configurable.
func (*ConcentrateResponsesClient) SetDefaultMaxTokens ¶
func (c *ConcentrateResponsesClient) SetDefaultMaxTokens(n int)
SetDefaultMaxTokens implements core.Configurable.
func (*ConcentrateResponsesClient) SetDefaultModel ¶
func (c *ConcentrateResponsesClient) SetDefaultModel(model string)
SetDefaultModel implements core.Configurable.
func (*ConcentrateResponsesClient) SetDefaultTemperature ¶
func (c *ConcentrateResponsesClient) SetDefaultTemperature(t float64)
SetDefaultTemperature implements core.Configurable.
func (*ConcentrateResponsesClient) SetGuardrails ¶
func (c *ConcentrateResponsesClient) SetGuardrails(g *core.Guardrails)
SetGuardrails implements core.Configurable.
func (*ConcentrateResponsesClient) SetHTTPClient ¶
func (c *ConcentrateResponsesClient) SetHTTPClient(hc *http.Client)
SetHTTPClient implements core.Configurable.
func (*ConcentrateResponsesClient) SetLogger ¶
func (c *ConcentrateResponsesClient) SetLogger(l *slog.Logger)
SetLogger implements core.Configurable.
func (*ConcentrateResponsesClient) SetMimoAuth ¶
func (c *ConcentrateResponsesClient) SetMimoAuth()
SetMimoAuth implements core.Configurable.
func (*ConcentrateResponsesClient) SetProviderName ¶
func (c *ConcentrateResponsesClient) SetProviderName(string)
SetProviderName implements core.Configurable.
func (*ConcentrateResponsesClient) SetRetry ¶
func (c *ConcentrateResponsesClient) SetRetry(rc core.RetryConfig)
SetRetry implements core.Configurable.
func (*ConcentrateResponsesClient) SetTimeout ¶
func (c *ConcentrateResponsesClient) SetTimeout(d time.Duration)
SetTimeout implements core.Configurable.
func (*ConcentrateResponsesClient) StreamChat ¶
func (c *ConcentrateResponsesClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
StreamChat implements core.Provider using the Responses API with SSE streaming.
func (*ConcentrateResponsesClient) Version ¶
func (c *ConcentrateResponsesClient) Version() string
Version implements core.Configurable.
type DeepSeekClient ¶
type DeepSeekClient struct {
// contains filtered or unexported fields
}
DeepSeekClient uses the OpenAI-compatible DeepSeek endpoint.
func NewDeepSeekClient ¶
func NewDeepSeekClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *DeepSeekClient
NewDeepSeekClient builds a DeepSeek provider client. openAIBase is typically "https://api.deepseek.com"
func (*DeepSeekClient) Chat ¶
func (c *DeepSeekClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*DeepSeekClient) Name ¶
func (c *DeepSeekClient) Name() string
func (*DeepSeekClient) StreamChat ¶
func (c *DeepSeekClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type GeminiClient ¶
type GeminiClient struct {
// contains filtered or unexported fields
}
GeminiClient implements core.Provider for the Google Gemini API.
func NewGeminiClient ¶
func NewGeminiClient(apiKey, baseURL string) *GeminiClient
func (*GeminiClient) Chat ¶
func (c *GeminiClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*GeminiClient) HTTPClient ¶
func (c *GeminiClient) HTTPClient() *http.Client
HTTPClient returns the configured transport client.
func (*GeminiClient) Name ¶
func (c *GeminiClient) Name() string
func (*GeminiClient) Retry ¶
func (c *GeminiClient) Retry() core.RetryConfig
Retry returns the configured retry policy.
func (*GeminiClient) StreamChat ¶
func (c *GeminiClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type GeminiOpenAIClient ¶
type GeminiOpenAIClient struct {
// contains filtered or unexported fields
}
GeminiOpenAIClient uses the OpenAI-compatible Gemini endpoint (generativelanguage.googleapis.com openai compatibility layer). Distinct from the native GeminiClient which uses generateContent.
func NewGeminiOpenAIClient ¶
func NewGeminiOpenAIClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *GeminiOpenAIClient
NewGeminiOpenAIClient builds a Gemini provider client over the OpenAI-compatible endpoint. openAIBase is typically "https://generativelanguage.googleapis.com/v1beta/openai".
func (*GeminiOpenAIClient) Chat ¶
func (c *GeminiOpenAIClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*GeminiOpenAIClient) Name ¶
func (c *GeminiOpenAIClient) Name() string
func (*GeminiOpenAIClient) StreamChat ¶
func (c *GeminiOpenAIClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type GrokClient ¶
type GrokClient struct {
// contains filtered or unexported fields
}
GrokClient uses the OpenAI-compatible xAI (Grok) endpoint.
func NewGrokClient ¶
func NewGrokClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *GrokClient
NewGrokClient builds an xAI (Grok) provider client. openAIBase is typically "https://api.x.ai/v1".
func (*GrokClient) Chat ¶
func (c *GrokClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*GrokClient) Name ¶
func (c *GrokClient) Name() string
func (*GrokClient) StreamChat ¶
func (c *GrokClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type GroqClient ¶
type GroqClient struct {
// contains filtered or unexported fields
}
GroqClient uses the OpenAI-compatible Groq endpoint.
func NewGroqClient ¶
func NewGroqClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *GroqClient
NewGroqClient builds a Groq provider client. openAIBase is typically "https://api.groq.com/openai/v1".
func (*GroqClient) Chat ¶
func (c *GroqClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*GroqClient) Name ¶
func (c *GroqClient) Name() string
func (*GroqClient) StreamChat ¶
func (c *GroqClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type KimiClient ¶
type KimiClient struct {
// contains filtered or unexported fields
}
KimiClient uses the OpenAI-compatible Kimi (Moonshot) endpoint.
func NewKimiClient ¶
func NewKimiClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *KimiClient
NewKimiClient builds a Kimi (Moonshot) provider client. openAIBase is typically "https://api.moonshot.ai/v1".
func (*KimiClient) Chat ¶
func (c *KimiClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*KimiClient) Name ¶
func (c *KimiClient) Name() string
func (*KimiClient) StreamChat ¶
func (c *KimiClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type LongCatClient ¶
type LongCatClient struct {
// contains filtered or unexported fields
}
LongCatClient uses the OpenAI-compatible LongCat endpoint first, with Anthropic-compatible fallback on retriable errors. Both protocols are documented at https://longcat.chat/platform/docs/api/chat and https://longcat.chat/platform/docs/api/messages.
func NewLongCatClient ¶
func NewLongCatClient(apiKey, openAIBase, anthropicBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *LongCatClient
NewLongCatClient builds a LongCat dual-protocol client. openAIBase should be "https://api.longcat.chat/openai/v1". anthropicBase should be "https://api.longcat.chat/anthropic". The same apiKey is used for both sides.
func (*LongCatClient) Chat ¶
func (c *LongCatClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*LongCatClient) Name ¶
func (c *LongCatClient) Name() string
func (*LongCatClient) StreamChat ¶
func (c *LongCatClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type MiMoClient ¶
type MiMoClient struct {
// contains filtered or unexported fields
}
MiMoClient uses the OpenAI-compatible MiMo endpoint.
func NewMiMoClient ¶
func NewMiMoClient(apiKey, openAIBase string, compat *OpenAICompatConfig, providerID string, opts ...core.ClientOption) *MiMoClient
NewMiMoClient builds a MiMo provider client (payg or token_plan gateway).
func (*MiMoClient) Chat ¶
func (c *MiMoClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*MiMoClient) Name ¶
func (c *MiMoClient) Name() string
func (*MiMoClient) ProviderID ¶
func (c *MiMoClient) ProviderID() string
ProviderID reports the configured MiMo gateway identity.
func (*MiMoClient) StreamChat ¶
func (c *MiMoClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type MiniMaxClient ¶
type MiniMaxClient struct {
// contains filtered or unexported fields
}
MiniMaxClient uses the OpenAI-compatible MiniMax endpoint.
func NewMiniMaxClient ¶
func NewMiniMaxClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *MiniMaxClient
NewMiniMaxClient builds a MiniMax provider client. openAIBase is typically "https://api.minimax.io/v1".
func (*MiniMaxClient) Chat ¶
func (c *MiniMaxClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*MiniMaxClient) Name ¶
func (c *MiniMaxClient) Name() string
func (*MiniMaxClient) StreamChat ¶
func (c *MiniMaxClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type OllamaClient ¶
type OllamaClient struct {
// contains filtered or unexported fields
}
OllamaClient uses the OpenAI-compatible local Ollama endpoint.
func NewOllamaClient ¶
func NewOllamaClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *OllamaClient
NewOllamaClient builds an Ollama provider client. openAIBase is typically "http://localhost:11434/v1".
func (*OllamaClient) Chat ¶
func (c *OllamaClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*OllamaClient) Name ¶
func (c *OllamaClient) Name() string
func (*OllamaClient) StreamChat ¶
func (c *OllamaClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func NewOpenAIClient ¶
func NewOpenAIClient(apiKey, baseURL string, compat *OpenAICompatConfig, opts ...core.ClientOption) *OpenAIClient
NewOpenAIClient creates a configured OpenAI/compatible client.
func (*OpenAIClient) BaseURL ¶
func (c *OpenAIClient) BaseURL() string
Inspection methods expose non-secret adapter configuration.
func (*OpenAIClient) BuildOpenAIRequest ¶
func (c *OpenAIClient) BuildOpenAIRequest(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions, stream bool) (*http.Request, []byte, error)
BuildOpenAIRequest constructs a complete OpenAI-compatible HTTP request.
func (*OpenAIClient) Chat ¶
func (c *OpenAIClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
Chat sends a non-streaming request.
func (*OpenAIClient) Compat ¶
func (c *OpenAIClient) Compat() *OpenAICompatConfig
func (*OpenAIClient) CreateEmbedding ¶
func (c *OpenAIClient) CreateEmbedding(ctx context.Context, req core.EmbeddingRequest) (*core.EmbeddingResponse, error)
CreateEmbedding sends an embedding request to the OpenAI-compatible API endpoint.
func (*OpenAIClient) DefaultMaxTokens ¶
func (c *OpenAIClient) DefaultMaxTokens() int
func (*OpenAIClient) DefaultModel ¶
func (c *OpenAIClient) DefaultModel() string
func (*OpenAIClient) DefaultTemperature ¶
func (c *OpenAIClient) DefaultTemperature() *float64
func (*OpenAIClient) Guardrails ¶
func (c *OpenAIClient) Guardrails() *core.Guardrails
func (*OpenAIClient) HTTPClient ¶
func (c *OpenAIClient) HTTPClient() *http.Client
func (*OpenAIClient) Logger ¶
func (c *OpenAIClient) Logger() *slog.Logger
func (*OpenAIClient) Ping ¶
func (c *OpenAIClient) Ping(ctx context.Context) error
Ping checks connectivity.
func (*OpenAIClient) ProviderName ¶
func (c *OpenAIClient) ProviderName() string
func (*OpenAIClient) Retry ¶
func (c *OpenAIClient) Retry() core.RetryConfig
func (*OpenAIClient) SetAPIKey ¶
func (c *OpenAIClient) SetAPIKey(key string)
SetAPIKey sets the API key.
func (*OpenAIClient) SetBaseURL ¶
func (c *OpenAIClient) SetBaseURL(url string)
SetBaseURL sets the base URL.
func (*OpenAIClient) SetDefaultMaxTokens ¶
func (c *OpenAIClient) SetDefaultMaxTokens(n int)
SetDefaultMaxTokens sets the default max tokens for requests.
func (*OpenAIClient) SetDefaultModel ¶
func (c *OpenAIClient) SetDefaultModel(model string)
SetDefaultModel sets the default model for requests.
func (*OpenAIClient) SetDefaultTemperature ¶
func (c *OpenAIClient) SetDefaultTemperature(t float64)
SetDefaultTemperature sets the default temperature for requests.
func (*OpenAIClient) SetGuardrails ¶
func (c *OpenAIClient) SetGuardrails(g *core.Guardrails)
SetGuardrails attaches output guardrails.
func (*OpenAIClient) SetHTTPClient ¶
func (c *OpenAIClient) SetHTTPClient(hc *http.Client)
SetHTTPClient replaces the HTTP client.
func (*OpenAIClient) SetLogger ¶
func (c *OpenAIClient) SetLogger(l *slog.Logger)
SetLogger sets the logger.
func (*OpenAIClient) SetMimoAuth ¶
func (c *OpenAIClient) SetMimoAuth()
SetMimoAuth switches authentication to MiMo's api-key header.
func (*OpenAIClient) SetProviderName ¶
func (c *OpenAIClient) SetProviderName(name string)
SetProviderName sets the provider name used in errors and logging.
func (*OpenAIClient) SetRetry ¶
func (c *OpenAIClient) SetRetry(rc core.RetryConfig)
SetRetry sets the retry configuration.
func (*OpenAIClient) SetTimeout ¶
func (c *OpenAIClient) SetTimeout(d time.Duration)
SetTimeout sets the HTTP client timeout.
func (*OpenAIClient) StreamChat ¶
func (c *OpenAIClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
StreamChat sends a streaming request.
type OpenAICompatConfig ¶
type OpenAICompatConfig struct {
SupportsStore bool `json:"supports_store,omitempty"`
SupportsDeveloperRole bool `json:"supports_developer_role,omitempty"`
SupportsReasoningEffort bool `json:"supports_reasoning_effort,omitempty"`
SupportsUsageInStreaming bool `json:"supports_usage_in_streaming,omitempty"`
SupportsStrictMode bool `json:"supports_strict_mode,omitempty"`
MaxTokensField string `json:"max_tokens_field,omitempty"` // "max_tokens" or "max_completion_tokens"
RequiresToolResultName bool `json:"requires_tool_result_name,omitempty"`
RequiresAssistantAfterToolResult bool `json:"requires_assistant_after_tool_result,omitempty"`
RequiresThinkingAsText bool `json:"requires_thinking_as_text,omitempty"`
ThinkingFormat string `json:"thinking_format,omitempty"` // "openai", "zai", "qwen", "openrouter"
// RequiresReasoningPassback instructs buildRequestBase to forward the
// reasoning_content captured from a prior assistant turn (core.GraycodeRouterMessage.Thinking)
// back into the request's assistant messages. DeepSeek requires the assistant's
// reasoning_content to be passed back whenever that turn performed a tool call,
// otherwise the API returns HTTP 400. When no tool call happened the field is
// ignored by the provider, so forwarding is always safe for compliant providers.
RequiresReasoningPassback bool `json:"requires_reasoning_passback,omitempty"`
// SupportsCacheRole enables Kimi/Moonshot context-cache injection: when
// core.ChatOptions.KimiContextCacheID is non-empty, buildRequestBase prepends a
// {"role":"cache","content":<id>} message per the MoonshotAI-Cookbook spec.
SupportsCacheRole bool `json:"supports_cache_role,omitempty"`
// OmitMaxTokens suppresses the max_tokens field so the provider applies
// its own default. Useful for providers that pre-authorize the maximum
// token cost (e.g. Agnes AI).
OmitMaxTokens bool `json:"omit_max_tokens,omitempty"`
// DefaultDisableThinking sets thinking to disabled when no thinking
// preference is provided. Useful for providers that enable thinking
// by default but don't support it in all configurations.
DefaultDisableThinking bool `json:"default_disable_thinking,omitempty"`
}
OpenAICompatConfig holds provider-specific compatibility flags that control how API requests are constructed for each provider.
type OpenAIEmbeddingData ¶
type OpenAIEmbeddingData = openaiEmbeddingData
type OpenAIEmbeddingResponse ¶
type OpenAIEmbeddingResponse = openaiEmbeddingResponse
type OpenAIEmbeddingUsage ¶
type OpenAIEmbeddingUsage = openaiEmbeddingUsage
type OpenAIRequest ¶
type OpenAIRequest = openaiRequest
func BuildRequestBase ¶
func BuildRequestBase(messages []core.GraycodeRouterMessage, opts core.ChatOptions, stream bool, compat *OpenAICompatConfig) OpenAIRequest
BuildRequestBase creates the provider-neutral OpenAI-compatible wire body.
type OpenAIResponse ¶
type OpenAIResponse = openaiResponse
type OpenCodeGoClient ¶
type OpenCodeGoClient struct {
// contains filtered or unexported fields
}
OpenCodeGoClient routes OpenCode Go models through OpenAIClient and AnthropicClient per opencode.ai/docs/go, with cross-protocol fallback when the primary path returns no answer text (e.g. reasoning-only MiniMax streams).
func NewOpenCodeGoClient ¶
func NewOpenCodeGoClient(apiKey, baseURL string, opts ...core.ClientOption) *OpenCodeGoClient
NewOpenCodeGoClient builds an OpenCode Go provider client.
func (*OpenCodeGoClient) Chat ¶
func (c *OpenCodeGoClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*OpenCodeGoClient) Name ¶
func (c *OpenCodeGoClient) Name() string
func (*OpenCodeGoClient) StreamChat ¶
func (c *OpenCodeGoClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type OpenGatewayClient ¶
type OpenGatewayClient struct {
// contains filtered or unexported fields
}
OpenGatewayClient uses the OpenAI-compatible OpenGateway endpoint.
func NewOpenGatewayClient ¶
func NewOpenGatewayClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *OpenGatewayClient
NewOpenGatewayClient builds an OpenGateway provider client. openAIBase is typically "https://opengateway.gitlawb.com/v1".
func (*OpenGatewayClient) Chat ¶
func (c *OpenGatewayClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*OpenGatewayClient) Name ¶
func (c *OpenGatewayClient) Name() string
func (*OpenGatewayClient) StreamChat ¶
func (c *OpenGatewayClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type OpenRouterClient ¶
type OpenRouterClient struct {
// contains filtered or unexported fields
}
OpenRouterClient uses the OpenAI-compatible OpenRouter endpoint.
func NewOpenRouterClient ¶
func NewOpenRouterClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *OpenRouterClient
NewOpenRouterClient builds an OpenRouter provider client. openAIBase is typically "https://openrouter.ai/api/v1".
func (*OpenRouterClient) Chat ¶
func (c *OpenRouterClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*OpenRouterClient) Name ¶
func (c *OpenRouterClient) Name() string
func (*OpenRouterClient) StreamChat ¶
func (c *OpenRouterClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type PoolsideClient ¶
type PoolsideClient struct {
// contains filtered or unexported fields
}
PoolsideClient uses Poolside's OpenAI-compatible transport and retries a reasoning-only stream once through the non-streaming endpoint. Laguna models can spend an entire streamed turn in reasoning while still returning answer content from a complete non-streaming request.
func NewPoolsideClient ¶
func NewPoolsideClient(apiKey, baseURL string, opts ...core.ClientOption) *PoolsideClient
func (*PoolsideClient) Chat ¶
func (c *PoolsideClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*PoolsideClient) Name ¶
func (c *PoolsideClient) Name() string
func (*PoolsideClient) StreamChat ¶
func (c *PoolsideClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type ProtocolChatFallback ¶
type ProtocolChatFallback func(primaryErr error, primaryResp *core.GraycodeRouterResponse) bool
ProtocolChatFallback decides whether to retry via the alternate protocol after the primary attempt. resp is non-nil only when primary returned err=nil.
type ProtocolRouter ¶
type ProtocolRouter struct {
OpenAI *OpenAIClient
Anthropic *AnthropicClient
}
ProtocolRouter picks between OpenAIClient and AnthropicClient for gateways that expose both APIs (OpenCode Go, MiMo). All HTTP work stays in openai.go and anthropic.go; this type only orchestrates routing and fallback.
func (ProtocolRouter) Chat ¶
func (r ProtocolRouter) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions, primary ChatProtocol, fallback ProtocolChatFallback) (*core.GraycodeRouterResponse, error)
Chat sends a request via the primary protocol, optionally falling back to the alternate protocol when fallback returns true.
func (ProtocolRouter) StreamChat ¶
func (r ProtocolRouter) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions, cfg ProtocolStreamConfig) (*core.StreamResult, error)
StreamChat streams via the primary protocol. When FallbackOnError matches, the alternate protocol is tried immediately. When ReasoningOnlyFallback is set and the primary is /v1/messages, an empty reasoning-only stream retries via chat/completions.
type ProtocolStreamConfig ¶
type ProtocolStreamConfig struct {
Primary ChatProtocol
FallbackOnError func(error) bool
ReasoningOnlyFallback bool // retry alternate protocol when primary stream is reasoning-only
}
ProtocolStreamConfig controls streaming across two protocols.
type ProviderRegistryConfig ¶
type ProviderRegistryConfig struct {
Name string `json:"name"`
Type ProviderType `json:"type"`
BaseURL string `json:"base_url,omitempty"`
EnvKey string `json:"env_key"`
SupportsStreaming bool `json:"supports_streaming"`
SupportsTools bool `json:"supports_tools"`
SupportsReasoning bool `json:"supports_reasoning"`
Compat *OpenAICompatConfig `json:"compat,omitempty"`
}
ProviderRegistryConfig holds provider registry info.
type ProviderType ¶
type ProviderType string
ProviderType classifies providers.
const ( // ProviderTypeAnthropic uses the Anthropic Messages API. ProviderTypeAnthropic ProviderType = "anthropic" // ProviderTypeOpenAI uses the OpenAI Chat Completions API. ProviderTypeOpenAI ProviderType = "openai" // ProviderTypeOpenAICompatible uses OpenAI-compatible APIs with custom base URLs. ProviderTypeOpenAICompatible ProviderType = "openai-compatible" // ProviderTypeAzure uses Azure OpenAI. ProviderTypeAzure ProviderType = "azure" // ProviderTypeBedrock uses AWS Bedrock. ProviderTypeBedrock ProviderType = "bedrock" // ProviderTypeVertex uses Google Vertex AI. ProviderTypeVertex ProviderType = "vertex" )
type StepFunClient ¶
type StepFunClient struct {
// contains filtered or unexported fields
}
StepFunClient uses the OpenAI-compatible StepFun endpoint. Official docs: https://platform.stepfun.com/docs/en/api-reference
func NewStepFunClient ¶
func NewStepFunClient(apiKey, openAIBase string, compat *OpenAICompatConfig, opts ...core.ClientOption) *StepFunClient
NewStepFunClient builds a StepFun provider client. openAIBase is typically "https://api.stepfun.ai/v1".
func (*StepFunClient) Chat ¶
func (c *StepFunClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*StepFunClient) Name ¶
func (c *StepFunClient) Name() string
func (*StepFunClient) StreamChat ¶
func (c *StepFunClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type TokenCountResult ¶
type TokenCountResult struct {
InputTokens int `json:"input_tokens"`
}
TokenCountResult holds the result of a token count request.
type VertexClient ¶
type VertexClient struct {
// contains filtered or unexported fields
}
func NewVertexClient ¶
func NewVertexClient(projectID, region, token string) *VertexClient
func (*VertexClient) BaseURL ¶
func (c *VertexClient) BaseURL() string
BaseURL returns the base URL for Vertex API requests.
func (*VertexClient) BuildBody ¶
func (c *VertexClient) BuildBody(messages []core.GraycodeRouterMessage, opts core.ChatOptions, stream bool) ([]byte, error)
BuildBody constructs the request body for Vertex API calls.
func (*VertexClient) Chat ¶
func (c *VertexClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*VertexClient) HTTPClient ¶
func (c *VertexClient) HTTPClient() *http.Client
HTTPClient returns the configured transport client.
func (*VertexClient) Name ¶
func (c *VertexClient) Name() string
func (*VertexClient) ProjectID ¶
func (c *VertexClient) ProjectID() string
ProjectID returns the configured Google Cloud project identifier.
func (*VertexClient) Region ¶
func (c *VertexClient) Region() string
Region returns the configured Google Cloud region.
func (*VertexClient) SetHTTPClient ¶
func (c *VertexClient) SetHTTPClient(hc *http.Client)
SetHTTPClient replaces the transport used for Vertex requests.
func (*VertexClient) SetRetry ¶
func (c *VertexClient) SetRetry(rc core.RetryConfig)
SetRetry configures provider retry behavior.
func (*VertexClient) StreamChat ¶
func (c *VertexClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
type ZAIClient ¶
type ZAIClient struct {
// contains filtered or unexported fields
}
ZAIClient uses the OpenAI-compatible endpoint (paas/v4 or coding/paas/v4) first, with Anthropic-compatible fallback (/api/anthropic) on retriable errors. This provides proper separation for General vs Coding Plan while giving both protocol surfaces (exactly as Xiaomi MiMo does for its plans).
func NewZAIClient ¶
func NewZAIClient(apiKey, openAIBase, anthropicBase string, compat *OpenAICompatConfig, providerID string, opts ...core.ClientOption) *ZAIClient
NewZAIClient builds a Z.AI dual-protocol client for a given plan/region gateway. openAIBase should be the resolved general or coding paas base. anthropicBase should be the resolved /api/anthropic (global or cn). The same apiKey is used for both sides; the plan subscription attached to the key controls quota/billing when using the coding path.
func (*ZAIClient) Chat ¶
func (c *ZAIClient) Chat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.GraycodeRouterResponse, error)
func (*ZAIClient) StreamChat ¶
func (c *ZAIClient) StreamChat(ctx context.Context, messages []core.GraycodeRouterMessage, opts core.ChatOptions) (*core.StreamResult, error)
Source Files
¶
- adapter_config.go
- agnes.go
- anthropic.go
- anthropic_base.go
- anthropic_cache.go
- azure.go
- bedrock.go
- canopywave.go
- clinepass.go
- compat.go
- concentrate_responses.go
- deepseek.go
- dynamic.go
- gemini.go
- gemini_direct.go
- grok.go
- groq.go
- kimi.go
- longcat.go
- mimo.go
- minimax.go
- ollama.go
- openai.go
- openai_embedding.go
- opencodego.go
- opengateway.go
- openrouter.go
- poolside.go
- protocol_router.go
- provider_registry.go
- stepfun.go
- vertex.go
- zai.go