Documentation
¶
Index ¶
- Constants
- 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 OllamaLoadingResult
- type ProviderConfig
- type ProviderInfo
- type ProviderResult
Constants ¶
const (
// ClaudeCodePrompt is the required system prompt for OAuth authentication
ClaudeCodePrompt = "You are Claude Code, Anthropic's official CLI for Claude."
)
Variables ¶
This section is empty.
Functions ¶
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 OllamaLoadingResult ¶ added in v0.18.0
OllamaLoadingResult contains the result of model loading with actual settings used
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 // TLS configuration TLSSkipVerify bool // Skip TLS certificate verification (insecure) }
ProviderConfig holds configuration for creating LLM providers
type ProviderInfo ¶ added in v0.14.0
type ProviderInfo struct { ID string Env []string NPM string Name string Models map[string]ModelInfo }
ProviderInfo represents information about a model provider
type ProviderResult ¶ added in v0.18.0
type ProviderResult struct { Model model.ToolCallingChatModel Message string // Optional message for user feedback (e.g., GPU fallback info) }
ProviderResult contains the result of provider creation
func CreateProvider ¶
func CreateProvider(ctx context.Context, config *ProviderConfig) (*ProviderResult, error)
CreateProvider creates an eino ToolCallingChatModel based on the provider configuration