tools

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package tools defines a standard interface for tools to be used by agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator struct {
	CallbacksHandler callbacks.Handler
}

Calculator is a tool that can do math.

func (Calculator) Call

func (c Calculator) Call(ctx context.Context, input string) (string, error)

Call evaluates the input using a starlak evaluator and returns the result as a string. If the evaluator errors the error is given in the result to give the agent the ability to retry.

func (Calculator) Description

func (c Calculator) Description() string

Description returns a string describing the calculator tool.

func (Calculator) Name

func (c Calculator) Name() string

Name returns the name of the tool.

type Tool

type Tool interface {
	Name() string
	Description() string
	Call(ctx context.Context, input string) (string, error)
}

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

Directories

Path Synopsis
Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client.
Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client.
// Package metaphor contains an implementation of the tool interface with the metaphor search api client.
// Package metaphor contains an implementation of the tool interface with the metaphor search api client.
Package scraper contains an implementation of the tool interface for a web scraping tool.
Package scraper contains an implementation of the tool interface for a web scraping tool.
Package serpapi contains an implementation of the tool interface with the serapi.
Package serpapi contains an implementation of the tool interface with the serapi.
Package wikipedia contains an implementation of the tool interface with the wikipedia api.
Package wikipedia contains an implementation of the tool interface with the wikipedia api.
Package zapier contains an implementation of the tool interface with the zapier NLA api client.
Package zapier contains an implementation of the tool interface with the zapier NLA api client.

Jump to

Keyboard shortcuts

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