Documentation
¶
Index ¶
- func NewEditFile(root *os.Root) gai.Tool
- func NewExec() gai.Tool
- func NewFetch(client *http.Client, completer gai.ChatCompleter) gai.Tool
- func NewGetMemories(mg memoryGetter) gai.Tool
- func NewGetTime(now func() time.Time) gai.Tool
- func NewListDir(root *os.Root) gai.Tool
- func NewReadFile(root *os.Root) gai.Tool
- func NewSaveMemory(ms memorySaver) gai.Tool
- func NewSearchMemories(ms memorySearcher) gai.Tool
- type EditFileArgs
- type ExecArgs
- type FetchArgs
- type GetMemoryArgs
- type GetTimeArgs
- type ListDirArgs
- type ReadFileArgs
- type SaveMemoryArgs
- type SearchMemoriesArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEditFile ¶
NewEditFile creates a new tool that edits or creates a file relative to the given os.Root.
func NewFetch ¶
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 ¶
NewGetMemories creates a new tool that returns all saved memories via the given memory getter.
func NewGetTime ¶
NewGetTime creates a new tool that returns the current date and time, given the time function.
func NewListDir ¶
NewListDir creates a new tool that recursively lists files and directories relative to the given os.Root.
func NewReadFile ¶
NewReadFile creates a new tool that reads the contents of a file relative to the given os.Root.
func NewSaveMemory ¶
NewSaveMemory creates a new tool that stores a memory via the given memory saver.
func NewSearchMemories ¶
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.