tools

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 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,
	"trivy":   Trivy,
	"kubectl": Kubectl,
}

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 Kubectl added in v0.5.1

func Kubectl(command string) (string, error)

Kubectl runs the given kubectl command and returns the output.

func PythonREPL

func PythonREPL(script string) (string, error)

PythonREPL runs the given Python script and returns the output.

func Trivy added in v0.5.1

func Trivy(image string) (string, error)

Trivy runs trivy against the image 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