tool

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHint added in v0.7.0

func ExtractHint(argsJSON, toolName string) string

func IntArg added in v0.6.9

func IntArg(args map[string]any, key string) (int, bool)

func IntValue added in v0.6.9

func IntValue(value any) (int, bool)

func NonNegIntArg added in v0.6.9

func NonNegIntArg(args map[string]any, key string) (value int, present bool, err error)

func OptionalIntArg added in v0.6.9

func OptionalIntArg(args map[string]any, key string) (int, bool, error)

func PositiveIntArg added in v0.6.9

func PositiveIntArg(args map[string]any, key string) (value int, present bool, err error)

func StaticEffect added in v0.6.2

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

Types

type Effect added in v0.6.2

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

type Elicitation added in v0.6.2

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

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.2

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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