tool

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StaticEffect added in v0.6.3

func StaticEffect(effect Effect) func(map[string]any) Effect

Types

type Effect added in v0.6.3

type Effect string
const (
	EffectReadOnly  Effect = "read_only"
	EffectMutates   Effect = "mutates"
	EffectDangerous Effect = "dangerous"
	EffectDynamic   Effect = "dynamic"
)

type Elicitation added in v0.6.3

type Elicitation struct {
	Ask     func(ctx context.Context, message string) (string, error)
	Confirm func(ctx context.Context, message string) (bool, error)
}

Elicitation allows tools to request information from the user.

type Tool

type Tool struct {
	Name        string
	Description string
	Parameters  map[string]any
	Execute     func(ctx context.Context, args map[string]any) (string, error)
	Hidden      bool
	Effect      func(args map[string]any) Effect
}

type ToolCall added in v0.6.3

type ToolCall struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Args string `json:"args,omitempty"`
}

ToolCall describes a pending tool invocation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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