Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownModel is returned when a model ID or alias is not found. ErrUnknownModel = errors.New("unknown model") // ErrNoProviders is returned when no providers are configured. ErrNoProviders = errors.New("no providers configured") // ErrProviderNotFound is returned when a referenced provider is not found. ErrProviderNotFound = errors.New("provider not found") // ErrAmbiguousModel is returned when a short model ID matches multiple providers. ErrAmbiguousModel = errors.New("ambiguous model ID") )
Functions ¶
This section is empty.
Types ¶
type AliasTarget ¶
type AliasTarget struct {
Provider string // Provider instance name
Model string // Model ID or local alias for that provider
}
AliasTarget points to a provider instance and model.
type Config ¶
type Config struct {
Name string // Aggregate provider name (defaults to "aggregate")
Providers []ProviderInstanceConfig // Named provider instances
Aliases map[string][]AliasTarget // Global alias -> ordered targets
}
Config is the complete aggregate configuration.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is an aggregate provider that routes requests to configured providers.
func New ¶
New creates an aggregate provider from configuration. factories maps provider type keys to constructor functions.
func (*Provider) CreateStream ¶
func (p *Provider) CreateStream(ctx context.Context, opts llm.StreamOptions) (<-chan llm.StreamEvent, error)
CreateStream creates a stream by routing to the appropriate provider. It tries each target in order until one succeeds or all fail.
type ProviderInstanceConfig ¶
type ProviderInstanceConfig struct {
Name string // Unique instance name
Type string // Provider type key (passed to factory)
Options []llm.Option // Options passed to factory
ModelAliases map[string]string // Local aliases: "sonnet" -> "claude-sonnet-4-5"
}
ProviderInstanceConfig configures a single provider instance.
Click to show internal directories.
Click to hide internal directories.