Documentation
¶
Index ¶
- Constants
- 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 ¶
This section is empty.
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. It maintains a registry of all supported LLM providers and their models, including capabilities, pricing, and configuration requirements. The registry data comes from the catwalk embedded database.
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 populated from the catwalk embedded database.
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
type OllamaLoadingResult struct {
Message string
}
OllamaLoadingResult contains the result of model loading with actual settings used.
type ProviderConfig ¶
type ProviderConfig struct {
ModelString string
SystemPrompt string
ProviderAPIKey string
ProviderURL string
MaxTokens int
Temperature *float32
TopP *float32
TopK *int32
StopSequences []string
NumGPU *int32
MainGPU *int32
TLSSkipVerify bool
}
ProviderConfig holds configuration for creating LLM providers.
type ProviderInfo ¶ added in v0.14.0
ProviderInfo represents information about a model provider.
type ProviderResult ¶ added in v0.18.0
type ProviderResult struct {
// Model is the created fantasy LanguageModel
Model fantasy.LanguageModel
// Message contains optional feedback for the user
Message string
}
ProviderResult contains the result of provider creation.
func CreateProvider ¶
func CreateProvider(ctx context.Context, config *ProviderConfig) (*ProviderResult, error)
CreateProvider creates a fantasy LanguageModel based on the provider configuration. It validates the model, checks required environment variables, and initializes the appropriate provider.
Supported providers: anthropic, openai, google, ollama, azure, google-vertex-anthropic, openrouter, bedrock