provider

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenAI    = "openai"
	Anthropic = "anthropic"
	Gemini    = "gemini"
	XAI       = "xai"
	Local     = "local"
)
View Source
const (
	OpenAIHost    = "api.openai.com"
	AnthropicHost = "api.anthropic.com"
	GeminiHost    = "generativelanguage.googleapis.com"
	XAIHost       = "api.x.ai"
)
View Source
const (
	OpenAIBaseURL    = "https://api.openai.com/v1"
	AnthropicBaseURL = "https://api.anthropic.com"
	GeminiBaseURL    = "https://generativelanguage.googleapis.com"
	XAIBaseURL       = "https://api.x.ai/v1"
	LocalBaseURL     = "http://127.0.0.1:11434"
)
View Source
const (
	OpenAIChatCompletionsPath = "/chat/completions"
	ResponsesPath             = "/responses"
	AnthropicMessagesPath     = "/v1/messages"
	OllamaNativeChatPath      = "/api/chat"
	OpenAIV1Path              = "/v1"
)
View Source
const (
	OpenAIDefaultModel    = "gpt-4.1-mini"
	AnthropicDefaultModel = "claude-sonnet-4-5"
	GeminiDefaultModel    = "gemini-2.5-flash"
	XAIDefaultModel       = "grok-4.3"
	LocalDefaultModel     = "llama3.1"
)
View Source
const (
	LocalAPIKey = Local

	AnthropicDefaultAPIVersion = "2023-06-01"
	AnthropicDefaultMaxTokens  = 1024
)
View Source
const (
	FieldEndpointURL = "endpoint URL"

	ConfigAPIKeyRequired              = "api key is required"
	ConfigMaxResponseBodyNonNegative  = "max response body must be non-negative"
	ConfigOpenAIEndpointRequiresMode  = "openai endpoint requires mode=openai"
	ConfigUnsupportedOpenAIEndpoint   = "unsupported openai endpoint %q"
	ConfigUnsupportedProviderWireMode = "unsupported mode %q"
)
View Source
const (
	ResponsesWireName = "responses"
)

Variables

This section is empty.

Functions

func ConfigError

func ConfigError(provider, message string) error

func ConfigErrorf

func ConfigErrorf(provider, format string, args ...any) error

func ConfigFieldWrapError

func ConfigFieldWrapError(provider, field string, err error) error

func ConfigWrapError

func ConfigWrapError(provider string, err error) error

func ProviderAPIKeyRequiredError

func ProviderAPIKeyRequiredError(provider string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL