toolkit

package module
v0.0.0-...-a215deb Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 3 Imported by: 3 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schema

type Schema struct {
	Parameters json.RawMessage `json:"parameters"`
	Returns    json.RawMessage `json:"returns"`
}

type Tool

type Tool interface {
	GetName() string
	GetDescription() string
	GetSchema() Schema
	Execute(ctx context.Context, params json.RawMessage) (json.RawMessage, error)
}

type Toolkit

type Toolkit struct {
	// contains filtered or unexported fields
}

Toolkit is a collection of tools

func NewToolkit

func NewToolkit(opts ...ToolkitOption) *Toolkit

func (*Toolkit) GetDescription

func (t *Toolkit) GetDescription() string

func (*Toolkit) GetName

func (t *Toolkit) GetName() string

func (*Toolkit) GetTool

func (t *Toolkit) GetTool(name string) (Tool, error)

func (*Toolkit) GetTools

func (t *Toolkit) GetTools() []Tool

func (*Toolkit) RegisterTool

func (t *Toolkit) RegisterTool(tool Tool) error

type ToolkitOption

type ToolkitOption func(*Toolkit)

ToolkitOption defines a function type for configuring a Toolkit

func WithToolkitDescription

func WithToolkitDescription(description string) ToolkitOption

func WithToolkitName

func WithToolkitName(name string) ToolkitOption

func WithTools

func WithTools(tools ...Tool) ToolkitOption

Directories

Path Synopsis
examples
calculator command

Jump to

Keyboard shortcuts

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