Documentation
¶
Index ¶
- func RegisterTool(tool Tool)
- type ASTEdit
- type ASTEditResults
- type Chat
- type CreateFile
- type CreateFileResults
- type CustomRegexFilter
- type EditFile
- type EditFileResults
- type File
- type FileInfo
- type Filter
- type FindInWorkspace
- type FindInWorkspaceResult
- type FunctionResult
- type ListInWorkspace
- type ListInWorkspaceResponse
- type Match
- type ReadFile
- type ReadFileResponse
- type RunShellCommand
- type RunShellCommandResults
- type RunTerminalCommand
- type RunTerminalCommandResults
- type Tool
- type Toolbox
- type VerifyCode
- type VerifyCodeResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTool ¶
func RegisterTool(tool Tool)
Types ¶
type ASTEdit ¶
type ASTEdit struct { Node string `json:"node"` Action string `json:"action"` Filename string `json:"filename"` }
func (*ASTEdit) BuildFunctionDefinition ¶
func (t *ASTEdit) BuildFunctionDefinition() *gollm.FunctionDefinition
type ASTEditResults ¶
type ASTEditResults struct {
Success bool `json:"success"`
}
type CreateFile ¶
type CreateFile struct { Contents string `json:"contents"` Filename string `json:"filename"` Overwrite bool `json:"overwrite"` }
func (*CreateFile) BuildFunctionDefinition ¶
func (t *CreateFile) BuildFunctionDefinition() *gollm.FunctionDefinition
type CreateFileResults ¶
type CreateFileResults struct {
Success bool `json:"success"`
}
type CustomRegexFilter ¶
type CustomRegexFilter struct {
// contains filtered or unexported fields
}
CustomRegexFilter implements the Filter interface. It allows for inclusion and exclusion of tools based on regex patterns. Note: If excludeRegex is not give, it will not exclude any tools.
func NewCustomRegexFilter ¶
func NewCustomRegexFilter(includeRegex, excludeRegex string) (*CustomRegexFilter, error)
func (*CustomRegexFilter) Exclude ¶
func (a *CustomRegexFilter) Exclude(tool Tool) bool
func (*CustomRegexFilter) Include ¶
func (a *CustomRegexFilter) Include(tool Tool) bool
type EditFile ¶
type EditFile struct { ExistingText string `json:"existing_text"` NewText string `json:"new_text"` Filename string `json:"filename"` }
func (*EditFile) BuildFunctionDefinition ¶
func (t *EditFile) BuildFunctionDefinition() *gollm.FunctionDefinition
type EditFileResults ¶
type EditFileResults struct {
Success bool `json:"success"`
}
type Filter ¶
type Filter interface { // Exclude methods determine if a tool should be excluded based on regex patterns. Exclude(tool Tool) bool // Include methods determine if a tool should be included based on regex patterns. Include(tool Tool) bool }
Filter interface for tools to be included or excluded based on regex patterns.
type FindInWorkspace ¶
type FindInWorkspace struct {
FindText string `json:"find_text"`
}
func (*FindInWorkspace) BuildFunctionDefinition ¶
func (t *FindInWorkspace) BuildFunctionDefinition() *gollm.FunctionDefinition
type FindInWorkspaceResult ¶
type FunctionResult ¶
type ListInWorkspace ¶
type ListInWorkspace struct {
FindFileName string `json:"find_file_name"`
}
func (*ListInWorkspace) BuildFunctionDefinition ¶
func (t *ListInWorkspace) BuildFunctionDefinition() *gollm.FunctionDefinition
type ListInWorkspaceResponse ¶
type ReadFile ¶
type ReadFile struct {
Filename string `json:"filename"`
}
func (*ReadFile) BuildFunctionDefinition ¶
func (t *ReadFile) BuildFunctionDefinition() *gollm.FunctionDefinition
type ReadFileResponse ¶
type ReadFileResponse struct {
Contents string `json:"contents"`
}
type RunShellCommand ¶
type RunShellCommand struct {
Command string `json:"shell_command"`
}
func (*RunShellCommand) BuildFunctionDefinition ¶
func (t *RunShellCommand) BuildFunctionDefinition() *gollm.FunctionDefinition
type RunShellCommandResults ¶
type RunTerminalCommand ¶
func (*RunTerminalCommand) BuildFunctionDefinition ¶
func (t *RunTerminalCommand) BuildFunctionDefinition() *gollm.FunctionDefinition
type Tool ¶
type Tool interface { BuildFunctionDefinition() *gollm.FunctionDefinition Run(ctx context.Context, c *Chat, args map[string]any) (any, error) }
func GetAllTools ¶
func GetAllTools() []Tool
func GetFilteredTools ¶
GetFilteredTools returns a list of tools that match the filter criteria. It excludes tools that are marked for exclusion and includes those that are marked for inclusion.
type Toolbox ¶
type Toolbox struct {
// contains filtered or unexported fields
}
func NewToolbox ¶
func (*Toolbox) CallFunction ¶
func (t *Toolbox) CallFunction(ctx context.Context, c *Chat, functionCall gollm.FunctionCall) (*FunctionResult, error)
func (*Toolbox) GetFunctionDefinitions ¶
func (t *Toolbox) GetFunctionDefinitions() []*gollm.FunctionDefinition
type VerifyCode ¶
type VerifyCode struct {
Filename string `json:"filename"`
}
func (*VerifyCode) BuildFunctionDefinition ¶
func (t *VerifyCode) BuildFunctionDefinition() *gollm.FunctionDefinition
type VerifyCodeResponse ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.