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",
},
}
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)
CreateChatCompletion(
ctx context.Context,
messages []chat.Message,
) (string, error)
}
Provider defines the interface for model providers
Click to show internal directories.
Click to hide internal directories.