tools

package
v0.0.0-...-3c14263 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEditFile

func NewEditFile(root *os.Root) gai.Tool

NewEditFile creates a new tool that edits or creates a file relative to the given os.Root.

func NewExec

func NewExec() gai.Tool

NewExec creates a new tool for executing shell commands.

func NewFetch

func NewFetch(client *http.Client, completer gai.ChatCompleter) gai.Tool

NewFetch creates a new tool for fetching content from a URL. If completer is provided, it will be used to convert HTML to Markdown when requested.

func NewGetMemories

func NewGetMemories(mg memoryGetter) gai.Tool

NewGetMemories creates a new tool that returns all saved memories via the given memory getter.

func NewGetTime

func NewGetTime(now func() time.Time) gai.Tool

NewGetTime creates a new tool that returns the current date and time, given the time function.

func NewListDir

func NewListDir(root *os.Root) gai.Tool

NewListDir creates a new tool that recursively lists files and directories relative to the given os.Root.

func NewReadFile

func NewReadFile(root *os.Root) gai.Tool

NewReadFile creates a new tool that reads the contents of a file relative to the given os.Root.

func NewSaveMemory

func NewSaveMemory(ms memorySaver) gai.Tool

NewSaveMemory creates a new tool that stores a memory via the given memory saver.

func NewSearchMemories

func NewSearchMemories(ms memorySearcher) gai.Tool

NewSearchMemories creates a new tool that searches saved memories by query via the given memory searcher.

Types

type EditFileArgs

type EditFileArgs struct {
	Path       string `json:"path" jsonschema_description:"The path to the file."`
	SearchStr  string `json:"search_str" jsonschema_description:"Text to search for. Must match exactly and must have one match exactly."`
	ReplaceStr string `json:"replace_str" jsonschema_description:"Text to replace search_str with."`
}

EditFileArgs holds the arguments for the EditFile tool.

type ExecArgs

type ExecArgs struct {
	Command string   `json:"command" jsonschema_description:"The command to execute."`
	Args    []string `json:"args,omitempty" jsonschema_description:"Arguments to pass to the command."`
	Input   string   `json:"input,omitempty" jsonschema_description:"Optional input to provide to stdin."`
	Timeout int      `json:"timeout,omitempty" jsonschema_description:"Optional timeout in seconds. Default is 30 seconds."`
}

ExecArgs holds the arguments for the Exec tool.

type FetchArgs

type FetchArgs struct {
	URL          string `json:"url" jsonschema_description:"The URL to fetch."`
	OutputFormat string `` /* 166-byte string literal not displayed */
}

FetchArgs holds the arguments for the Fetch tool.

type GetMemoryArgs

type GetMemoryArgs struct{}

GetMemoryArgs holds the arguments for the GetMemories tool.

type GetTimeArgs

type GetTimeArgs struct{}

type ListDirArgs

type ListDirArgs struct {
	Path string `` /* 152-byte string literal not displayed */
}

ListDirArgs holds the arguments for the ListDir tool.

type ReadFileArgs

type ReadFileArgs struct {
	Path string `json:"path" jsonschema_description:"The relative path of a file in the working directory."`
}

ReadFileArgs holds the arguments for the ReadFile tool.

type SaveMemoryArgs

type SaveMemoryArgs struct {
	Memory string `json:"memory"`
}

SaveMemoryArgs holds the arguments for the SaveMemory tool.

type SearchMemoriesArgs

type SearchMemoriesArgs struct {
	Query string `json:"query"`
}

SearchMemoriesArgs holds the arguments for the SearchMemories tool.

Jump to

Keyboard shortcuts

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