Documentation
¶
Index ¶
- func NewExecTool(timeoutSec int, restrictToWorkspace bool, workspaceDir string) (tool.InvokableTool, error)
- func NewListDirTool() (tool.InvokableTool, error)
- func NewReadFileTool() (tool.InvokableTool, error)
- func NewWriteFileTool() (tool.InvokableTool, error)
- type ExecInput
- type ExecOutput
- type ListDirInput
- type ReadFileInput
- type ReadFileOutput
- type Registry
- func (r *Registry) Execute(ctx context.Context, name string, argsJSON string) (string, error)
- func (r *Registry) Get(name string) (tool.InvokableTool, bool)
- func (r *Registry) GetToolInfos(ctx context.Context) ([]*schema.ToolInfo, error)
- func (r *Registry) List() []tool.InvokableTool
- func (r *Registry) Names() []string
- func (r *Registry) Register(t tool.InvokableTool) error
- type WriteFileInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecTool ¶
func NewExecTool(timeoutSec int, restrictToWorkspace bool, workspaceDir string) (tool.InvokableTool, error)
NewExecTool creates the exec tool
func NewListDirTool ¶
func NewListDirTool() (tool.InvokableTool, error)
NewListDirTool creates the list_dir tool
func NewReadFileTool ¶
func NewReadFileTool() (tool.InvokableTool, error)
NewReadFileTool creates the read_file tool
func NewWriteFileTool ¶
func NewWriteFileTool() (tool.InvokableTool, error)
NewWriteFileTool creates the write_file tool
Types ¶
type ExecInput ¶
type ExecInput struct {
Command string `json:"command" jsonschema:"required,description=Shell command to execute"`
WorkingDir string `json:"working_dir" jsonschema:"description=Working directory for the command"`
}
ExecInput parameters for exec tool
type ExecOutput ¶
type ExecOutput struct {
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
ExitCode int `json:"exit_code"`
}
ExecOutput result of exec tool
type ListDirInput ¶
type ListDirInput struct {
Path string `json:"path" jsonschema:"required,description=Directory path to list"`
}
ListDirInput parameters for list_dir tool
type ReadFileInput ¶
type ReadFileInput struct {
Path string `json:"path" jsonschema:"required,description=Absolute path to the file"`
Offset int `json:"offset" jsonschema:"description=Starting line number (0-based)"`
Limit int `json:"limit" jsonschema:"description=Maximum number of lines to read"`
}
ReadFileInput parameters for read_file tool
type ReadFileOutput ¶
ReadFileOutput result of read_file tool
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages tools by name
func (*Registry) Get ¶
func (r *Registry) Get(name string) (tool.InvokableTool, bool)
Get retrieves a tool by name
func (*Registry) GetToolInfos ¶
GetToolInfos returns all tool schemas for ChatModel binding
type WriteFileInput ¶
type WriteFileInput struct {
Path string `json:"path" jsonschema:"required,description=Absolute path to the file"`
Content string `json:"content" jsonschema:"required,description=Content to write"`
}
WriteFileInput parameters for write_file tool
Click to show internal directories.
Click to hide internal directories.