config

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultModels = map[string]string{
	"openai":    "gpt-5-mini",
	"anthropic": "claude-sonnet-4-0",
	"google":    "gemini-2.5-flash",
	"dmr":       "ai/qwen3:latest",
	"mistral":   "mistral-small-latest",
}

Functions

func ApplyModelOverrides added in v1.7.0

func ApplyModelOverrides(cfg *latest.Config, overrides []string) error

ApplyModelOverrides applies CLI model overrides to the configuration

func AutoEmbeddingModelConfigs added in v1.9.16

func AutoEmbeddingModelConfigs() []latest.ModelConfig

AutoEmbeddingModelConfigs returns the ordered list of embedding-capable models to try when a RAG strategy uses `model: auto` for embeddings.

The priority is:

  1. OpenAI -> text-embedding-3-small model
  2. DMR -> Google's embeddinggemma model (via Docker Model Runner)

func AutoModelConfig added in v1.9.14

func AutoModelConfig(ctx context.Context, modelsGateway string, env environment.Provider) latest.ModelConfig

func AvailableProviders added in v1.9.14

func AvailableProviders(ctx context.Context, modelsGateway string, env environment.Provider) []string

func CheckRequiredEnvVars added in v1.8.0

func CheckRequiredEnvVars(ctx context.Context, cfg *latest.Config, modelsGateway string, env environment.Provider) error

CheckRequiredEnvVars checks which environment variables are required by the models and tools.

This allows exiting early with a proper error message instead of failing later when trying to use a model or tool.

func GatherEnvVarsForModels added in v1.8.0

func GatherEnvVarsForModels(cfg *latest.Config) []string

func GatherEnvVarsForTools added in v1.8.0

func GatherEnvVarsForTools(ctx context.Context, cfg *latest.Config) ([]string, error)

func IsOCIReference added in v1.9.27

func IsOCIReference(input string) bool

IsOCIReference checks if the input is a valid OCI reference

func IsURLReference added in v1.9.29

func IsURLReference(input string) bool

IsURLReference checks if the input is a valid HTTP/HTTPS URL.

func Load added in v1.9.27

func Load(ctx context.Context, source Reader) (*latest.Config, error)

func Parsers added in v1.9.22

func Parsers() map[string]func([]byte) (any, error)

func PreferredMaxTokens added in v1.9.14

func PreferredMaxTokens(provider string) *int64

func Upgrades added in v1.9.22

func Upgrades() []func(any) (any, error)

Types

type Config added in v1.9.22

type Config struct {
	EnvFiles       []string
	ModelsGateway  string
	GlobalCodeMode bool
	WorkingDir     string
}

type Reader added in v1.9.27

type Reader interface {
	Read(ctx context.Context) ([]byte, error)
}

type RuntimeConfig added in v1.0.5

type RuntimeConfig struct {
	Config

	EnvProviderForTests environment.Provider
	// contains filtered or unexported fields
}

func (*RuntimeConfig) Clone added in v1.9.22

func (runConfig *RuntimeConfig) Clone() *RuntimeConfig

func (*RuntimeConfig) EnvProvider added in v1.9.14

func (runConfig *RuntimeConfig) EnvProvider() environment.Provider

type Source added in v1.9.27

type Source interface {
	Name() string
	ParentDir() string
	Read(ctx context.Context) ([]byte, error)
}

func NewBytesSource added in v1.9.27

func NewBytesSource(name string, data []byte) Source

func NewFileSource added in v1.9.27

func NewFileSource(path string) Source

func NewOCISource added in v1.9.27

func NewOCISource(reference string) Source

func NewURLSource added in v1.9.29

func NewURLSource(url string) Source

func Resolve added in v1.9.27

func Resolve(agentFilename string) (Source, error)

Resolve resolves an agent file reference (local file, URL, or OCI image) to a source For OCI references, always checks remote for updates but falls back to local cache if offline

type Sources added in v1.9.27

type Sources map[string]Source

func ResolveSources added in v1.9.27

func ResolveSources(agentsPath string) (Sources, error)

ResolveSources resolves an agent file reference (local file, URL, or OCI image) to sources For OCI references, always checks remote for updates but falls back to local cache if offline

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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