Documentation
¶
Overview ¶
Package config provides configuration management for agent applications. It supports loading from environment variables with sensible defaults.
Index ¶
- func GetDefaultModel(provider string) string
- type Config
- type SecureConfig
- func (sc *SecureConfig) Close() error
- func (sc *SecureConfig) Environment() vaultguard.Environment
- func (sc *SecureConfig) GetCredential(ctx context.Context, name string) (string, error)
- func (sc *SecureConfig) GetRequiredCredentials(ctx context.Context, names ...string) (map[string]string, error)
- func (sc *SecureConfig) SecurityResult() *vaultguard.SecurityResult
- type SecureConfigOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultModel ¶
GetDefaultModel returns the default model for a given provider.
Types ¶
type Config ¶
type Config struct {
// LLM Configuration
LLMProvider string // "gemini", "claude", "openai", "ollama", "xai"
LLMAPIKey string
LLMModel string
LLMBaseURL string // For Ollama or custom endpoints
// Provider-specific API keys
GeminiAPIKey string
ClaudeAPIKey string
OpenAIAPIKey string
XAIAPIKey string
OllamaURL string
// Search Configuration
SearchProvider string // "serper", "serpapi"
SerperAPIKey string
SerpAPIKey string
// Agent URLs (for multi-agent systems)
AgentURLs map[string]string
// A2A Protocol Configuration
A2AEnabled bool
A2AAuthType string // "jwt", "apikey", "oauth2"
A2AAuthToken string
// Observability Configuration
ObservabilityEnabled bool // Enable LLM observability
ObservabilityProvider string // "opik", "langfuse", "phoenix"
ObservabilityAPIKey string
ObservabilityEndpoint string // Custom endpoint (optional)
ObservabilityProject string // Project name for grouping traces
// Security Configuration
SecurityEnabled bool // Enable VaultGuard security checks
SecurityMinScore int // Minimum security score (0-100)
SecurityRequireEncry bool // Require disk encryption
}
Config holds the application configuration.
func LoadConfig ¶
func LoadConfig() *Config
LoadConfig loads configuration from environment variables.
func (*Config) GetAgentURL ¶
GetAgentURL gets the URL for a named agent.
func (*Config) SetAgentURL ¶
SetAgentURL sets a URL for a named agent.
type SecureConfig ¶
type SecureConfig struct {
*Config
// contains filtered or unexported fields
}
SecureConfig wraps Config with VaultGuard for secure credential access.
func LoadSecureConfig ¶
func LoadSecureConfig(ctx context.Context, opts ...SecureConfigOption) (*SecureConfig, error)
LoadSecureConfig loads configuration with VaultGuard security checks. It enforces security policies based on the environment (local or cloud).
func (*SecureConfig) Environment ¶
func (sc *SecureConfig) Environment() vaultguard.Environment
Environment returns the detected deployment environment.
func (*SecureConfig) GetCredential ¶
GetCredential retrieves a credential from the secure vault.
func (*SecureConfig) GetRequiredCredentials ¶
func (sc *SecureConfig) GetRequiredCredentials(ctx context.Context, names ...string) (map[string]string, error)
GetRequiredCredentials retrieves multiple credentials, failing if any are missing.
func (*SecureConfig) SecurityResult ¶
func (sc *SecureConfig) SecurityResult() *vaultguard.SecurityResult
SecurityResult returns the security assessment result.
type SecureConfigOption ¶
type SecureConfigOption func(*secureConfigOptions)
SecureConfigOption configures secure config loading.
func WithDevPolicy ¶
func WithDevPolicy() SecureConfigOption
WithDevPolicy uses a permissive development policy.
func WithPolicy ¶
func WithPolicy(policy *vaultguard.Policy) SecureConfigOption
WithPolicy sets a custom security policy.
func WithStrictPolicy ¶
func WithStrictPolicy() SecureConfigOption
WithStrictPolicy uses a strict security policy.