Documentation
¶
Index ¶
Constants ¶
View Source
const KeyDefaultModel = "default_model"
Well-known setting keys.
Variables ¶
View Source
var DefaultModels = []ModelOption{
{Value: "haiku", Label: "Haiku"},
{Value: "sonnet", Label: "Sonnet"},
{Value: "opus", Label: "Opus"},
}
DefaultModels is the built-in list of Claude model options when CLAUDE_MODELS is not set.
View Source
var ErrNotFound = errors.New("setting not found")
ErrNotFound is returned when a setting key does not exist.
Functions ¶
This section is empty.
Types ¶
type ModelOption ¶
ModelOption describes an available model for the UI.
func ParseModelsEnv ¶
func ParseModelsEnv(s string) []ModelOption
ParseModelsEnv parses a comma-separated CLAUDE_MODELS environment variable into a slice of ModelOption. Each entry is "value" or "value:label". Example: "haiku,sonnet,opus" or "claude-3-haiku:Haiku,claude-3-sonnet:Sonnet".
type Repository ¶
type Repository interface {
UpsertSetting(ctx context.Context, key, value string) error
ReadSetting(ctx context.Context, key string) (string, error)
DeleteSetting(ctx context.Context, key string) error
ListSettings(ctx context.Context) (map[string]string, error)
}
Repository defines data access for key-value settings.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides cached access to key-value settings.
func NewService ¶
func NewService(repo Repository) *Service
NewService creates a new settings service.
Click to show internal directories.
Click to hide internal directories.