tools

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxReadBytes = 256 * 1024

MaxReadBytes caps the total bytes ReadFile will return in a single call. Files larger than this must be paged via offset/limit.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bash

type Bash struct {
	Timeout time.Duration
}

func (Bash) Name

func (Bash) Name() string

func (Bash) Run

func (b Bash) Run(ctx context.Context, input map[string]any) (string, error)

func (Bash) Spec

func (Bash) Spec() llm.ToolSpec

type EditFile

type EditFile struct{}

func (EditFile) Name

func (EditFile) Name() string

func (EditFile) Run

func (EditFile) Run(ctx context.Context, input map[string]any) (string, error)

func (EditFile) Spec

func (EditFile) Spec() llm.ToolSpec

type ReadFile

type ReadFile struct{}

func (ReadFile) Name

func (ReadFile) Name() string

func (ReadFile) Run

func (ReadFile) Run(_ context.Context, input map[string]any) (string, error)

func (ReadFile) Spec

func (ReadFile) Spec() llm.ToolSpec

type Registry

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

func NewRegistry

func NewRegistry(ts ...Tool) *Registry

func (*Registry) Filter

func (r *Registry) Filter(names []string) *Registry

func (*Registry) Get

func (r *Registry) Get(name string) (Tool, bool)

func (*Registry) Specs

func (r *Registry) Specs() []llm.ToolSpec

type Tool

type Tool interface {
	Name() string
	Spec() llm.ToolSpec
	Run(ctx context.Context, input map[string]any) (string, error)
}

type WriteFile

type WriteFile struct{}

func (WriteFile) Name

func (WriteFile) Name() string

func (WriteFile) Run

func (WriteFile) Run(ctx context.Context, input map[string]any) (string, error)

func (WriteFile) Spec

func (WriteFile) Spec() llm.ToolSpec

Jump to

Keyboard shortcuts

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