config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileSystem afero.Fs = afero.NewOsFs()

FileSystem TODO: Properly inject the file system in the future (see _discover/registration)

View Source
var LookPath = exec.LookPath

Os is the operating system

Functions

func CommandExists added in v0.0.9

func CommandExists(cmd string) bool

CommandExists checks if a command exists in the system's PATH

func IsDesktop added in v0.0.9

func IsDesktop() bool

func WithConfig added in v0.0.9

func WithConfig(ctx context.Context, config *Config) context.Context

Types

type Config

type Config struct {
	// TODO: Should be moved to a separate InferenceConfig (same as is done for Tools -> ToolsConfig)
	Inference *string // An inference to use, if not set, the best inference will be used
	Model     *string // A model to use, if not set, the best model will be used
	// contains filtered or unexported fields
}

func GetConfig added in v0.0.9

func GetConfig(ctx context.Context) *Config

func New

func New() *Config

func (*Config) Enforce added in v0.0.10

func (c *Config) Enforce(policies *api.Policies)

func (*Config) GeminiModel

func (c *Config) GeminiModel() string

func (*Config) GoogleApiKey

func (c *Config) GoogleApiKey() string

func (*Config) ToolsParameters added in v0.0.10

func (c *Config) ToolsParameters(toolName string) api.ToolsParameters

ToolsParameters returns the merged tool configuration parameters for a specific tool

TODO: moved this here from the tools package. IMO this should be maintained in this package which should hold

the single source of truth for configuration
IMO 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 (feature.Discover +

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

Jump to

Keyboard shortcuts

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