Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCommandToTool ¶
func ConvertCommandToTool(desc *cmds.CommandDescription) (protocol.Tool, error)
Types ¶
type Config ¶
type Config struct {
Version string `yaml:"version"`
DefaultProfile string `yaml:"defaultProfile"`
Profiles map[string]*Profile `yaml:"profiles"`
}
Config represents the root configuration
func LoadFromFile ¶
LoadFromFile loads a configuration from a YAML file
type ConfigPromptProvider ¶
type ConfigPromptProvider struct {
// contains filtered or unexported fields
}
ConfigPromptProvider implements pkg.PromptProvider interface
func NewConfigPromptProvider ¶
func NewConfigPromptProvider(config *Config, profile string) (*ConfigPromptProvider, error)
func (*ConfigPromptProvider) GetPrompt ¶
func (p *ConfigPromptProvider) GetPrompt(name string, arguments map[string]string) (*protocol.PromptMessage, error)
GetPrompt implements pkg.PromptProvider interface
func (*ConfigPromptProvider) ListPrompts ¶
ListPrompts implements pkg.PromptProvider interface
type ConfigToolProvider ¶
type ConfigToolProvider struct {
// contains filtered or unexported fields
}
ConfigToolProvider implements pkg.ToolProvider interface
func NewConfigToolProvider ¶
func NewConfigToolProvider(options ...ConfigToolProviderOption) (*ConfigToolProvider, error)
NewConfigToolProvider creates a new ConfigToolProvider with the given options
func (*ConfigToolProvider) CallTool ¶
func (p *ConfigToolProvider) CallTool(ctx context.Context, name string, arguments map[string]interface{}) (*protocol.ToolResult, error)
CallTool implements pkg.ToolProvider interface
type ConfigToolProviderOption ¶
type ConfigToolProviderOption func(*ConfigToolProvider) error
func WithConfig ¶
func WithConfig(config *Config, profile string) ConfigToolProviderOption
func WithDebug ¶
func WithDebug(debug bool) ConfigToolProviderOption
func WithDirectories ¶
func WithDirectories(directories []repositories.Directory) ConfigToolProviderOption
func WithTracingDir ¶
func WithTracingDir(dir string) ConfigToolProviderOption
type LayerParameters ¶
LayerParameters maps layer names to their parameter settings
type ParameterFilter ¶
ParameterFilter maps layer names to lists of parameter names
type Profile ¶
type Profile struct {
Description string `yaml:"description"`
Tools *ToolSources `yaml:"tools"`
Prompts *PromptSources `yaml:"prompts"`
}
Profile represents a named configuration profile
type PromptSources ¶
type PromptSources struct {
Directories []SourceConfig `yaml:"directories,omitempty"`
Files []SourceConfig `yaml:"files,omitempty"`
Pinocchio *struct {
Command string `yaml:"command"`
Args []string `yaml:"args,omitempty"`
SourceConfig `yaml:",inline"`
} `yaml:"pinocchio,omitempty"`
}
PromptSources configures where prompts are loaded from
type SourceConfig ¶
type SourceConfig struct {
Path string `yaml:"path"`
Defaults LayerParameters `yaml:"defaults,omitempty"`
Overrides LayerParameters `yaml:"overrides,omitempty"`
Blacklist ParameterFilter `yaml:"blacklist,omitempty"`
Whitelist ParameterFilter `yaml:"whitelist,omitempty"`
}
Common source configuration for both tools and prompts
type ToolSources ¶
type ToolSources struct {
Directories []SourceConfig `yaml:"directories,omitempty"`
Files []SourceConfig `yaml:"files,omitempty"`
ExternalCommands []struct {
Command string `yaml:"command"`
Args []string `yaml:"args,omitempty"`
SourceConfig `yaml:",inline"`
} `yaml:"external_commands,omitempty"`
}
ToolSources configures where tools are loaded from