Documentation
¶
Index ¶
- Variables
- func ApplyModelOverrides(cfg *latest.Config, overrides []string) error
- func AutoEmbeddingModelConfigs() []latest.ModelConfig
- func AutoModelConfig(ctx context.Context, modelsGateway string, env environment.Provider, ...) latest.ModelConfig
- func AvailableProviders(ctx context.Context, modelsGateway string, env environment.Provider) []string
- func BuiltinAgentNames() []string
- func CheckRequiredEnvVars(ctx context.Context, cfg *latest.Config, modelsGateway string, ...) error
- func GatherEnvVarsForModels(cfg *latest.Config) []string
- func GatherEnvVarsForTools(ctx context.Context, cfg *latest.Config) ([]string, error)
- func IsExternalReference(input string) bool
- func IsOCIReference(input string) bool
- func IsURLReference(input string) bool
- func Load(ctx context.Context, source Source) (*latest.Config, error)
- func PreferredMaxTokens(provider string) *int64
- func ResolveAlias(agentFilename string) *userconfig.Alias
- func ResolveModelAliases(ctx context.Context, cfg *latest.Config, store *modelsdev.Store)
- type AutoModelFallbackError
- type Config
- type RuntimeConfig
- type Source
- type Sources
Constants ¶
This section is empty.
Variables ¶
var DefaultModels = map[string]string{
"openai": "gpt-5-mini",
"anthropic": "claude-sonnet-4-5",
"google": "gemini-2.5-flash",
"dmr": "ai/qwen3:latest",
"mistral": "mistral-small-latest",
"amazon-bedrock": "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
}
Functions ¶
func ApplyModelOverrides ¶
ApplyModelOverrides applies CLI model overrides to the configuration
func AutoEmbeddingModelConfigs ¶
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:
- OpenAI -> text-embedding-3-small model
- DMR -> Google's embeddinggemma model (via Docker Model Runner)
func AutoModelConfig ¶
func AutoModelConfig(ctx context.Context, modelsGateway string, env environment.Provider, defaultModel *latest.ModelConfig) latest.ModelConfig
func AvailableProviders ¶
func BuiltinAgentNames ¶
func BuiltinAgentNames() []string
BuiltinAgentNames returns the names of all built-in agents.
func CheckRequiredEnvVars ¶
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 ¶
func GatherEnvVarsForTools ¶
func IsExternalReference ¶
IsExternalReference reports whether the input is an external agent reference (OCI image or URL) rather than a local agent name defined in the same config. Local agent names never contain "/", so the slash check distinguishes them from OCI references like "agentcatalog/pirate" or "docker.io/org/agent:v1".
func IsOCIReference ¶
IsOCIReference checks if the input is a valid OCI reference
func IsURLReference ¶
IsURLReference checks if the input is a valid HTTP/HTTPS URL.
func PreferredMaxTokens ¶
func ResolveAlias ¶
func ResolveAlias(agentFilename string) *userconfig.Alias
ResolveAlias resolves an agent reference and returns the alias if it exists and has options. Returns nil if the reference is not an alias or doesn't have options.
func ResolveModelAliases ¶
ResolveModelAliases resolves model aliases to their pinned versions in the config. For example, "claude-sonnet-4-5" might resolve to "claude-sonnet-4-5-20250929". This modifies the config in place.
NOTE: Alias resolution is skipped for models with custom base_url configurations, either set directly on the model or inherited from a custom provider definition. This is necessary because external providers (like Azure Foundry) may use the alias names directly as deployment names rather than the pinned version names.
Types ¶
type AutoModelFallbackError ¶
type AutoModelFallbackError struct{}
AutoModelFallbackError is returned when auto model selection fails because no providers are available (no API keys configured and DMR not installed).
func (*AutoModelFallbackError) Error ¶
func (e *AutoModelFallbackError) Error() string
type RuntimeConfig ¶
type RuntimeConfig struct {
Config
EnvProviderForTests environment.Provider
// contains filtered or unexported fields
}
func (*RuntimeConfig) Clone ¶
func (runConfig *RuntimeConfig) Clone() *RuntimeConfig
func (*RuntimeConfig) EnvProvider ¶
func (runConfig *RuntimeConfig) EnvProvider() environment.Provider
type Source ¶
type Source interface {
Name() string
ParentDir() string
Read(ctx context.Context) ([]byte, error)
}
func NewBytesSource ¶
func NewFileSource ¶
func NewOCISource ¶
func NewURLSource ¶
func NewURLSource(rawURL string, envProvider environment.Provider) Source
NewURLSource creates a new URL source. If envProvider is non-nil, it will be used to look up GITHUB_TOKEN for authentication when fetching from GitHub URLs.
func Resolve ¶
func Resolve(agentFilename string, envProvider environment.Provider) (Source, error)
Resolve resolves an agent file reference (local file, URL, or OCI image) to a source. If envProvider is non-nil, it will be used to look up GITHUB_TOKEN for authentication when fetching from GitHub URLs. For OCI references, always checks remote for updates but falls back to local cache if offline.
type Sources ¶
func ResolveSources ¶
func ResolveSources(agentsPath string, envProvider environment.Provider) (Sources, error)
ResolveSources resolves an agent file reference (local file, URL, or OCI image) to sources. If envProvider is non-nil, it will be used to look up GITHUB_TOKEN for authentication when fetching from GitHub URLs. For OCI references, always checks remote for updates but falls back to local cache if offline.