Documentation
¶
Overview ¶
Package llmfactory provides factories and configuration for LLM model instantiation, supporting multiple providers (OpenAI, Azure, etc.) and model selection strategies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Providers []*ProviderConfig `json:"providers" yaml:"providers"`
}
type Factory ¶
type Factory interface {
// DefaultModel returns the default LLM model.
DefaultModel() (llms.Model, error)
// ModelByType returns an LLM model by its type.
ModelByType(typ string) (llms.Model, error)
// ModelByName returns an LLM model by its name.
ModelByName(name string) (llms.Model, error)
}
Factory is the interface for creating and managing LLM models.
type OpenAIConfig ¶
type OpenAIConfig struct {
BaseURL string `json:"base_url,omitempty" yaml:"base_url,omitempty"`
APIVersion string `json:"api_version,omitempty" yaml:"api_version,omitempty"`
// APIType specifies the type of API to use:
// OPEN_AI|AZURE|AZURE_AD|CLOUDFLARE_AZURE
APIType string `json:"api_type,omitempty" yaml:"api_type,omitempty"`
// OrgID specifies which organization's quota and billing should be used when making API requests.
OrgID string `json:"org_id,omitempty" yaml:"org_id,omitempty"`
AssistantVersion string `json:"assistant_version,omitempty" yaml:"assistant_version,omitempty"`
}
OpenAIConfig specifies options config
type ProviderConfig ¶
type ProviderConfig struct {
Name string `json:"name" yaml:"name"`
Token string `json:"token,omitempty" yaml:"token,omitempty"`
DefaultModel string `json:"default_model,omitempty" yaml:"default_model,omitempty"`
AvailableModels []string `json:"available_models,omitempty" yaml:"available_models,omitempty"`
OpenAI OpenAIConfig `json:"open_ai" yaml:"open_ai"`
}
ProviderConfig for the OpenAI provider
Click to show internal directories.
Click to hide internal directories.