tool

package
v0.0.0-...-68b491e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	ID string
	// The name of the tool to call.
	Name      string
	Arguments string
}

Call provides the content for a tool action.

type Discovery

type Discovery interface {
	Get(ctx context.Context, name string) (Tool, error)
	All(ctx context.Context) []Tool
	Refresh(ctx context.Context) error
}

type Option

type Option func(t *Tool)

func WithAddr

func WithAddr(addr url.URL) Option

func WithDescription

func WithDescription(description string) Option

func WithName

func WithName(name string) Option

func WithParameters

func WithParameters(properties map[string]any, required []string) Option

type Parameters

type Parameters struct {
	Properties map[string]any
	Required   []string
}

type Response

type Response struct {
	ID      string
	Content string
}

Response containes the output of the called tool.

type Tool

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

Tool represents a remote tool service and all data needed to call it.

func MakeTool

func MakeTool(options ...Option) (Tool, error)

func TestToolA

func TestToolA() Tool

func TestToolB

func TestToolB() Tool

func TestTools

func TestTools() []Tool

func (Tool) Addr

func (t Tool) Addr() url.URL

func (Tool) Description

func (t Tool) Description() string

func (Tool) Name

func (t Tool) Name() string

func (Tool) Parameters

func (t Tool) Parameters() Parameters

Directories

Path Synopsis
discovery

Jump to

Keyboard shortcuts

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