Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderAliases = map[string]Alias{
"requesty": {
APIType: "openai",
BaseURL: "https://router.requesty.ai/v1",
TokenEnvVar: "REQUESTY_API_KEY",
},
"azure": {
APIType: "openai",
TokenEnvVar: "AZURE_API_KEY",
},
"xai": {
APIType: "openai",
BaseURL: "https://api.x.ai/v1",
TokenEnvVar: "XAI_API_KEY",
},
"nebius": {
APIType: "openai",
BaseURL: "https://api.studio.nebius.com/v1",
TokenEnvVar: "NEBIUS_API_KEY",
},
"mistral": {
APIType: "openai",
BaseURL: "https://api.mistral.ai/v1",
TokenEnvVar: "MISTRAL_API_KEY",
},
}
ProviderAliases maps provider names to their corresponding configurations
Functions ¶
This section is empty.
Types ¶
type Alias ¶ added in v1.0.10
type Alias struct {
APIType string // The actual API type to use (openai, anthropic, etc.)
BaseURL string // Default base URL for the provider
TokenEnvVar string // Environment variable name for the API token
}
Alias defines the configuration for a provider alias
type Provider ¶
type Provider interface {
// ID returns the model provider ID
ID() string
// CreateChatCompletionStream creates a streaming chat completion request
// It returns a stream that can be iterated over to get completion chunks
CreateChatCompletionStream(
ctx context.Context,
messages []chat.Message,
tools []tools.Tool,
) (chat.MessageStream, error)
// BaseConfig returns the base configuration of this provider
BaseConfig() base.Config
}
Provider defines the interface for model providers
func CloneWithOptions ¶ added in v1.7.1
CloneWithOptions returns a new Provider instance using the same provider/model as the base provider, applying the provided options. If cloning fails, the original base provider is returned.
Click to show internal directories.
Click to hide internal directories.