Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.0.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultInferenceEnabled = true
)

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 {
	InferenceConfig InferenceConfig `toml:"inferences,omitempty"`
	// contains filtered or unexported fields
}

func GetConfig added in v0.0.9

func GetConfig(ctx context.Context) *Config

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) Enforce added in v0.0.10

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

func (*Config) Inference added in v0.0.9

func (c *Config) Inference() *string

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 (c *Config) IsInferenceProviderEnabled(feature api.Feature[api.InferenceAttributes]) bool

func (*Config) IsToolsProviderEnabled added in v0.0.11

func (c *Config) IsToolsProviderEnabled(feature api.Feature[api.ToolsAttributes]) bool

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

Jump to

Keyboard shortcuts

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