config

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ProviderAnthropic        = "anthropic"
	ProviderOpenAI           = "openai"
	ProviderOpenAICodex      = "openai-codex"
	ProviderGoogleAI         = "googleai"
	ProviderMoonshotAI       = "moonshotai"
	ProviderDeepSeek         = "deepseek"
	ProviderZAI              = "zai"
	ProviderMiniMax          = "minimax"
	ProviderOpenCodeGo       = "opencode-go"
	ProviderYoloAuto         = "yolo-auto"
	ProviderBedrock          = "amazon-bedrock"
	ProviderOpenAICompatible = "openai-compatible"
	ProviderTypeSafe         = "typesafe"
	ProviderLiquid           = "liquid"
)
View Source
const (
	AuthModeAPIKey = "api_key"
	AuthModeOAuth  = "oauth"
	AuthModeAWS    = "aws"
)
View Source
const (
	RouterCategorySimple   = "simple"
	RouterCategoryStandard = "standard"
	RouterCategoryComplex  = "complex"
)
View Source
const ConfigFixHint = "To fix configs manually, check ~/.keen/configs.json"

Variables

This section is empty.

Functions

func AuthModeForProvider

func AuthModeForProvider(provider string) string

func ConfigDir

func ConfigDir() string

func ConfigPath

func ConfigPath() string

func RequiresAPIKey

func RequiresAPIKey(provider string) bool

func ResolveProviderAPIKey

func ResolveProviderAPIKey(provider string, providerCfg ProviderConfig) (string, error)

func SaveProjectPermissions

func SaveProjectPermissions(workingDir string, perms *ProjectPermissions) error

func SupportsAPIKey

func SupportsAPIKey(provider string) bool

Types

type APIKeyResolver

type APIKeyResolver struct {
	// contains filtered or unexported fields
}

APIKeyResolver caches a key resolved via apiKeyHelper and refreshes it on demand.

func NewAPIKeyResolver

func NewAPIKeyResolver(provider, helper string) *APIKeyResolver

func (*APIKeyResolver) Get

func (r *APIKeyResolver) Get() (string, error)

func (*APIKeyResolver) Refresh

func (r *APIKeyResolver) Refresh() (string, error)

type DecisionConfig added in v0.59.0

type DecisionConfig struct {
	ActiveProvider string                    `json:"active_provider,omitempty"`
	ActiveModel    string                    `json:"active_model,omitempty"`
	Providers      map[string]ProviderConfig `json:"providers,omitempty"`
}

type GlobalConfig

type GlobalConfig struct {
	ActiveProvider    string                    `json:"active_provider"`
	ActiveModel       string                    `json:"active_model"`
	ThinkingEffort    string                    `json:"thinking_effort,omitempty"`
	ShowThinking      *bool                     `json:"show_thinking,omitempty"`
	AdversaryProvider string                    `json:"adversary_provider,omitempty"`
	AdversaryModel    string                    `json:"adversary_model,omitempty"`
	Providers         map[string]ProviderConfig `json:"providers"`
	Decision          *DecisionConfig           `json:"decision,omitempty"`
	Router            *RouterConfig             `json:"router,omitempty"`
}

func DefaultGlobalConfig

func DefaultGlobalConfig() *GlobalConfig

func (*GlobalConfig) AddModel

func (g *GlobalConfig) AddModel(provider string, model string)

func (*GlobalConfig) GetProviderConfig

func (g *GlobalConfig) GetProviderConfig(provider string) (ProviderConfig, bool)

func (*GlobalConfig) SetProviderConfig

func (g *GlobalConfig) SetProviderConfig(provider string, cfg ProviderConfig)

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader() *Loader

func NewLoaderWithPath added in v0.61.0

func NewLoaderWithPath(path string) *Loader

func (*Loader) Exists

func (l *Loader) Exists() bool

func (*Loader) Load

func (l *Loader) Load() (*GlobalConfig, error)

func (*Loader) Save

func (l *Loader) Save(cfg *GlobalConfig) error

type ProjectPermissions

type ProjectPermissions struct {
	Allow ToolSet `json:"allow"`
}

func LoadProjectPermissions

func LoadProjectPermissions(workingDir string) (*ProjectPermissions, error)

func NewProjectPermissions

func NewProjectPermissions() *ProjectPermissions

type ProviderConfig

type ProviderConfig struct {
	Models       []string          `json:"models"`
	APIKey       string            `json:"api_key"`
	APIKeyHelper string            `json:"api_key_helper,omitempty"`
	BaseURL      string            `json:"base_url,omitempty"`
	Headers      map[string]string `json:"headers,omitempty"`
}

type ResolvedConfig

type ResolvedConfig struct {
	Provider       string
	APIKey         string
	APIKeyHelper   string
	Model          string
	ThinkingEffort string
	BaseURL        string
	AuthMode       string
	Headers        map[string]string
}

func ResolveAdversary

func ResolveAdversary(global *GlobalConfig) (*ResolvedConfig, error)

func ResolveProvider

func ResolveProvider(global *GlobalConfig, provider, model, thinkingEffort string) (*ResolvedConfig, error)

type ResolvedDecisionConfig added in v0.59.0

type ResolvedDecisionConfig struct {
	Provider string
	Model    string
	Config   json.RawMessage
}

func ResolveDecision added in v0.59.0

func ResolveDecision(global *GlobalConfig) (*ResolvedDecisionConfig, error)

type RouterConfig added in v0.60.0

type RouterConfig struct {
	Enabled  bool        `json:"enabled"`
	Simple   RouterModel `json:"simple"`
	Standard RouterModel `json:"standard"`
	Complex  RouterModel `json:"complex"`
}

func (*RouterConfig) Configured added in v0.60.0

func (r *RouterConfig) Configured() bool

func (*RouterConfig) ModelForCategory added in v0.60.0

func (r *RouterConfig) ModelForCategory(category string) RouterModel

type RouterModel added in v0.60.0

type RouterModel struct {
	Provider       string `json:"provider"`
	Model          string `json:"model"`
	ThinkingEffort string `json:"thinking_effort,omitempty"`
}

type ToolSet

type ToolSet map[string]struct{}

func (ToolSet) Contains

func (ts ToolSet) Contains(name string) bool

func (ToolSet) MarshalJSON

func (ts ToolSet) MarshalJSON() ([]byte, error)

func (*ToolSet) UnmarshalJSON

func (ts *ToolSet) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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