Documentation
¶
Index ¶
- func CreateProvider(ctx context.Context, config *ProviderConfig) (model.ToolCallingChatModel, error)
- func GetModelsData() map[string]ProviderInfo
- type Cost
- type Limit
- type ModelInfo
- type ModelsRegistry
- func (r *ModelsRegistry) GetModelsForProvider(provider string) (map[string]ModelInfo, error)
- func (r *ModelsRegistry) GetRequiredEnvVars(provider string) ([]string, error)
- func (r *ModelsRegistry) GetSupportedProviders() []string
- func (r *ModelsRegistry) SuggestModels(provider, invalidModel string) []string
- func (r *ModelsRegistry) ValidateEnvironment(provider string, apiKey string) error
- func (r *ModelsRegistry) ValidateModel(provider, modelID string) (*ModelInfo, error)
- type ProviderConfig
- type ProviderInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProvider ¶
func CreateProvider(ctx context.Context, config *ProviderConfig) (model.ToolCallingChatModel, error)
CreateProvider creates an eino ToolCallingChatModel based on the provider configuration
func GetModelsData ¶ added in v0.14.0
func GetModelsData() map[string]ProviderInfo
GetModelsData returns the static models data from models.dev
Types ¶
type ModelInfo ¶ added in v0.14.0
type ModelInfo struct {
ID string
Name string
Attachment bool
Reasoning bool
Temperature bool
Cost Cost
Limit Limit
}
ModelInfo represents information about a specific model
type ModelsRegistry ¶ added in v0.14.0
type ModelsRegistry struct {
// contains filtered or unexported fields
}
ModelsRegistry provides validation and information about models
func GetGlobalRegistry ¶ added in v0.14.0
func GetGlobalRegistry() *ModelsRegistry
GetGlobalRegistry returns the global models registry instance
func NewModelsRegistry ¶ added in v0.14.0
func NewModelsRegistry() *ModelsRegistry
NewModelsRegistry creates a new models registry with static data
func (*ModelsRegistry) GetModelsForProvider ¶ added in v0.14.0
func (r *ModelsRegistry) GetModelsForProvider(provider string) (map[string]ModelInfo, error)
GetModelsForProvider returns all models for a specific provider
func (*ModelsRegistry) GetRequiredEnvVars ¶ added in v0.14.0
func (r *ModelsRegistry) GetRequiredEnvVars(provider string) ([]string, error)
GetRequiredEnvVars returns the required environment variables for a provider
func (*ModelsRegistry) GetSupportedProviders ¶ added in v0.14.0
func (r *ModelsRegistry) GetSupportedProviders() []string
GetSupportedProviders returns a list of all supported providers
func (*ModelsRegistry) SuggestModels ¶ added in v0.14.0
func (r *ModelsRegistry) SuggestModels(provider, invalidModel string) []string
SuggestModels returns similar model names when an invalid model is provided
func (*ModelsRegistry) ValidateEnvironment ¶ added in v0.14.0
func (r *ModelsRegistry) ValidateEnvironment(provider string, apiKey string) error
ValidateEnvironment checks if required environment variables are set
func (*ModelsRegistry) ValidateModel ¶ added in v0.14.0
func (r *ModelsRegistry) ValidateModel(provider, modelID string) (*ModelInfo, error)
ValidateModel validates if a model exists and returns detailed information
type ProviderConfig ¶
type ProviderConfig struct {
ModelString string
SystemPrompt string
ProviderAPIKey string // API key for OpenAI and Anthropic
ProviderURL string // Base URL for OpenAI, Anthropic, and Ollama
// Model generation parameters
MaxTokens int
Temperature *float32
TopP *float32
TopK *int32
StopSequences []string
// Ollama-specific parameters
NumGPU *int32
MainGPU *int32
}
ProviderConfig holds configuration for creating LLM providers