tools

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDescriptions

func GetDescriptions(list ...ITool) string

Types

type Callback

type Callback interface {
	OnToolStart(context.Context, ITool, string)
	OnToolEnd(context.Context, ITool, string, string)
	OnToolError(context.Context, ITool, string, error)
}

type ITool

type ITool interface {
	// Name returns the name of the Tool.
	Name() string
	// Description returns the description of the tool, to be used in the prompt.
	// Should not exceed LLM model limit.
	Description() string
	// Parameters returns the parameters definition of the function, to be used in the prompt.
	Parameters() any

	Call(context.Context, string) (string, error)
}

ITool is a tool for the llm agent to interact with different applications.

type Tool

type Tool[I any, O any] interface {
	ITool
	Run(context.Context, *I) (*O, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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