tools

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CopilotTools = map[string]Tool{
	"search": GoogleSearch,
	"python": PythonREPL,
}

CopilotTools is a map of tool names to tools.

Functions

func GoogleSearch

func GoogleSearch(query string) (string, error)

GoogleSearch returns the results of a Google search for the given query.

func PythonREPL

func PythonREPL(script string) (string, error)

PythonREPL runs the given Python script and returns the output.

Types

type Tool

type Tool func(input string) (string, error)

Tool is a function that takes an input and returns an output.

type ToolPrompt

type ToolPrompt struct {
	Question string `json:"question"`
	Thought  string `json:"thought,omitempty"`
	Action   struct {
		Name  string `json:"name"`
		Input string `json:"input"`
	} `json:"action,omitempty"`
	Observation string `json:"observation,omitempty"`
	FinalAnswer string `json:"final_answer,omitempty"`
}

ToolPrompt is the JSON format for the prompt.

Jump to

Keyboard shortcuts

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