tool

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe

func Describe(ctx context.Context, h Handler) (string, error)

Describe gets a tool description, or an empty string if the tool doesn't provide additional description.

func MustUnmarshalFn

func MustUnmarshalFn(data []byte) provider.ToolFunction

MustUnmarshalFn unmarshals a JSON-encoded tool function and panics on error.

func MustUnmarshalTool

func MustUnmarshalTool(data []byte) provider.Tool

MustUnmarshalTool unmarshals a JSON-encoded tool and panics on error.

func UnmarshalFn

func UnmarshalFn(data []byte) (provider.ToolFunction, error)

UnmarshalFn unmarshals a JSON-encoded tool function and returns a ToolFunction struct.

func UnmarshalTool

func UnmarshalTool(data []byte) (provider.Tool, error)

UnmarshalTool unmarshals a JSON-encoded tool and returns a Tool struct.

Types

type DescriptionSource

type DescriptionSource interface {
	// Describe gets a string that describes, what the tool is about
	// to do when executed with given arguments.
	Describe(ctx context.Context) (string, error)
}

type Handler

type Handler interface {
	Execute(ctx context.Context) (any, error)
}

Handler defines an interface for executing tools.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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