Documentation
¶
Index ¶
- Constants
- Variables
- func CommandExists(cmd string) bool
- func IsDesktop() bool
- func WithConfig(ctx context.Context, config *Config) context.Context
- type Config
- func (c *Config) Enforce(policies *api.Policies)
- func (c *Config) Inference() *string
- func (c *Config) InferenceParameters(inferenceProviderName string) api.InferenceParameters
- func (c *Config) IsInferenceProviderEnabled(feature api.Feature[api.InferenceAttributes]) bool
- func (c *Config) IsToolsProviderEnabled(feature api.Feature[api.ToolsAttributes]) bool
- func (c *Config) ToolsParameters(toolProviderName string) api.ToolsParameters
- type InferenceConfig
- type ToolsConfig
Constants ¶
const (
DefaultInferenceEnabled = true
)
Variables ¶
var FileSystem afero.Fs = afero.NewOsFs()
FileSystem TODO: Properly inject the file system in the future (see _discover/registration)
var LookPath = exec.LookPath
var Os = runtime.GOOS
Os is the operating system
Functions ¶
func CommandExists ¶ added in v0.0.9
CommandExists checks if a command exists in the system's PATH
Types ¶
type Config ¶
type Config struct {
InferenceConfig InferenceConfig `toml:"inferences,omitempty"`
// contains filtered or unexported fields
}
func New ¶
func New() *Config
New creates a new configuration with defaults
TBD: The workflow for configuration should be: 1) config.New creates a new Config with the default values (there's a test in the config package to ensure a spec) 2) The default config can be overridden by the user (Either by providing a partial config file -config.Read- or by using cmd flags -cmd.DiscoverCmdOptions-) 3) The merged configuration is restricted/enforced by the policies Config.Enforce
func (*Config) InferenceParameters ¶ added in v0.0.11
func (c *Config) InferenceParameters(inferenceProviderName string) api.InferenceParameters
InferenceParameters returns the merged inference configuration parameters for a specific provider It considers both the global configuration and the provider-specific configuration Provider-specific configuration takes precedence over global configuration
func (*Config) IsInferenceProviderEnabled ¶ added in v0.0.11
func (*Config) IsToolsProviderEnabled ¶ added in v0.0.11
func (*Config) ToolsParameters ¶ added in v0.0.10
func (c *Config) ToolsParameters(toolProviderName string) api.ToolsParameters
ToolsParameters returns the merged tool configuration parameters for a specific tool It considers both the global configuration and the provider-specific configuration Provider-specific configuration takes precedence over global configuration
type InferenceConfig ¶ added in v0.0.11
type InferenceConfig struct {
Inference *string // An inference to use, if not set, the best inference will be used
// Provider InferenceParameters specific for a provider
Provider map[string]api.InferenceParameters `toml:"provider,omitempty"`
// InferenceParameters Global parameters for all tools
api.InferenceParameters
}
type ToolsConfig ¶ added in v0.0.10
type ToolsConfig struct {
// Provider ToolParameters specific for a provider
Provider map[string]api.ToolsParameters `toml:"provider,omitempty"`
// ToolParameters Global parameters for all tools
api.ToolsParameters
}
ToolsConfig Configuration for tools