Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithToolkit ¶ added in v0.1.0
WithToolkit sets a toolkit for generation options. The toolkit is stored under opt.ToolkitKey and can be retrieved with opts.Get(opt.ToolkitKey) and type-asserted to *Toolkit.
Types ¶
type Tool ¶ added in v0.1.0
type Tool interface {
// Return the name of the tool
Name() string
// Return the description of the tool
Description() string
// Return the JSON schema for the tool input
Schema() (*jsonschema.Schema, error)
// Run the tool with the given input as JSON (may be nil)
Run(ctx context.Context, input json.RawMessage) (any, error)
}
Tool is an interface for a tool with a name, description and JSON schema
type Toolkit ¶ added in v0.1.0
type Toolkit struct {
// contains filtered or unexported fields
}
Toolkit is a collection of tools with unique names
func NewToolkit ¶ added in v0.1.0
NewToolkit creates a new toolkit with the given tools. Returns an error if any tool has an invalid or duplicate name.
func (*Toolkit) Feedback ¶ added in v0.1.0
Feedback returns a human-readable description of a tool call, including the tool name and its description when available.
func (*Toolkit) Register ¶ added in v0.1.0
Register adds one or more tools to the toolkit. Returns an error if any tool has an invalid or duplicate name.