models

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
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 Cost added in v0.14.0

type Cost struct {
	Input      float64
	Output     float64
	CacheRead  *float64
	CacheWrite *float64
}

Cost represents the pricing information for a model

type Limit added in v0.14.0

type Limit struct {
	Context int
	Output  int
}

Limit represents the context and output limits for a model

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

type OllamaLoadingResult struct {
	Options *api.Options
	Message string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL