tools

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

type Tool struct {
	Model        string   `yaml:"model,omitempty" json:"model,omitempty" toml:"model,omitempty"`
	Key          string   `yaml:"key,omitempty" json:"key,omitempty" toml:"key,omitempty"`
	URL          string   `yaml:"url,omitempty" json:"url,omitempty" toml:"url,omitempty"`
	ReasonEffort string   `yaml:"reason,omitempty" json:"reason,omitempty" toml:"reason,omitempty"`
	Temperature  *float64 `yaml:"temperature,omitempty" json:"temperature,omitempty" toml:"temperature,omitempty"`
	SystemPrompt string   `yaml:"system,omitempty" json:"system,omitempty" toml:"system,omitempty"`
	UserTemplate string   `yaml:"user,omitempty" json:"user,omitempty" toml:"user,omitempty"`
	Action       string   `yaml:"action,omitempty" json:"action,omitempty" toml:"action,omitempty"`
	MCPs         []string `yaml:"mcps,omitempty" json:"mcps,omitempty" toml:"mcps,omitempty"`
}

Tool represents the configuration for a language model tool, when specified, will override global settings.

func Load

func Load(name string) (Tool, error)

func (*Tool) DoAction added in v0.2.12

func (tool *Tool) DoAction(content []byte, params map[string]string, confirmed bool) error

DoAction executes the configured action for the tool. It supports printing to stdout, copying to clipboard, saving to disk and executing commands. Placeholders in the action string (e.g. ${name}) are replaced by the provided params and result content. When confirmed is false, the user will be asked to confirm before performing non-output actions.

func (*Tool) UserPrompt

func (tool *Tool) UserPrompt(user string) string

Jump to

Keyboard shortcuts

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