Documentation
¶
Index ¶
- Constants
- Variables
- func NewHandler[T any](fn func(_ context.Context, params T) (*tools.ToolCallResult, error)) ...
- type APITool
- type APIToolOption
- type AddAllowedDirectoryArgs
- type AddMemoryArgs
- type AddToolArgs
- type CreateTodoArgs
- type CreateTodosArgs
- type DB
- type DeferredToolset
- func (d *DeferredToolset) AddSource(toolset tools.ToolSet, deferAll bool, toolNames []string)
- func (d *DeferredToolset) HasSources() bool
- func (d *DeferredToolset) Instructions() string
- func (d *DeferredToolset) Start(ctx context.Context) error
- func (d *DeferredToolset) Tools(context.Context) ([]tools.Tool, error)
- type DeleteMemoryArgs
- type DirectoryTreeArgs
- type Edit
- type EditFileArgs
- type FetchResult
- type FetchTool
- type FetchToolArgs
- type FetchToolOption
- type FileSystemOpt
- type FilesystemTool
- type HandoffArgs
- type HandoffTool
- type ListDirectoryArgs
- type ListDirectoryMeta
- type MemoryTool
- type PostEditConfig
- type QueryRAGArgs
- type QueryResult
- type RAGTool
- type ReadFileArgs
- type ReadFileMeta
- type ReadMultipleFilesArgs
- type ReadMultipleFilesMeta
- type RunShellArgs
- type RunShellBackgroundArgs
- type ScriptShellTool
- type SearchFilesArgs
- type SearchFilesContentArgs
- type SearchToolArgs
- type SearchToolResult
- type ShellTool
- type StopBackgroundJobArgs
- type ThinkArgs
- type ThinkTool
- type Todo
- type TodoTool
- type TransferTaskArgs
- type TransferTaskTool
- type UpdateTodoArgs
- type ViewBackgroundJobArgs
- type WriteFileArgs
Constants ¶
View Source
const ( ToolNameSearchTool = "search_tool" ToolNameAddTool = "add_tool" )
View Source
const ( ToolNameReadFile = "read_file" ToolNameReadMultipleFiles = "read_multiple_files" ToolNameEditFile = "edit_file" ToolNameWriteFile = "write_file" ToolNameListAllowedDirectories = "list_allowed_directories" ToolNameAddAllowedDirectory = "add_allowed_directory" ToolNameDirectoryTree = "directory_tree" ToolNameListDirectory = "list_directory" ToolNameSearchFiles = "search_files" ToolNameSearchFilesContent = "search_files_content" )
View Source
const ( ToolNameAddMemory = "add_memory" ToolNameGetMemories = "get_memories" ToolNameDeleteMemory = "delete_memory" )
View Source
const ( ToolNameShell = "shell" ToolNameRunShellBackground = "run_background_job" ToolNameListBackgroundJobs = "list_background_jobs" ToolNameViewBackgroundJob = "view_background_job" ToolNameStopBackgroundJob = "stop_background_job" )
View Source
const ( ToolNameCreateTodo = "create_todo" ToolNameCreateTodos = "create_todos" ToolNameUpdateTodo = "update_todo" ToolNameListTodos = "list_todos" )
View Source
const (
ToolNameFetch = "fetch"
)
View Source
const ToolNameHandoff = "handoff"
View Source
const ToolNameThink = "think"
View Source
const ToolNameTransferTask = "transfer_task"
Variables ¶
Functions ¶
func NewHandler ¶ added in v1.10.1
Types ¶
type APITool ¶ added in v1.9.11
type APITool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewAPITool ¶ added in v1.9.11
func NewAPITool(config latest.APIToolConfig) *APITool
func (*APITool) Instructions ¶ added in v1.9.11
type APIToolOption ¶ added in v1.9.11
type APIToolOption func(*APITool)
type AddAllowedDirectoryArgs ¶ added in v1.7.1
type AddAllowedDirectoryArgs struct {
Path string `json:"path" jsonschema:"The directory path to add to allowed directories"`
}
type AddMemoryArgs ¶ added in v1.7.1
type AddMemoryArgs struct {
Memory string `json:"memory" jsonschema:"The memory content to store"`
}
type AddToolArgs ¶ added in v1.9.24
type AddToolArgs struct {
Name string `json:"name" jsonschema:"The name of the tool to activate"`
}
type CreateTodoArgs ¶ added in v1.7.1
type CreateTodoArgs struct {
Description string `json:"description" jsonschema:"Description of the todo item"`
}
type CreateTodosArgs ¶ added in v1.7.1
type CreateTodosArgs struct {
Descriptions []string `json:"descriptions" jsonschema:"Descriptions of the todo items"`
}
type DB ¶ added in v1.8.0
type DB interface {
AddMemory(ctx context.Context, memory database.UserMemory) error
GetMemories(ctx context.Context) ([]database.UserMemory, error)
DeleteMemory(ctx context.Context, memory database.UserMemory) error
}
type DeferredToolset ¶ added in v1.9.24
type DeferredToolset struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewDeferredToolset ¶ added in v1.9.24
func NewDeferredToolset() *DeferredToolset
func (*DeferredToolset) AddSource ¶ added in v1.9.24
func (d *DeferredToolset) AddSource(toolset tools.ToolSet, deferAll bool, toolNames []string)
func (*DeferredToolset) HasSources ¶ added in v1.9.24
func (d *DeferredToolset) HasSources() bool
func (*DeferredToolset) Instructions ¶ added in v1.9.24
func (d *DeferredToolset) Instructions() string
type DeleteMemoryArgs ¶ added in v1.7.1
type DeleteMemoryArgs struct {
ID string `json:"id" jsonschema:"The ID of the memory to delete"`
}
type DirectoryTreeArgs ¶ added in v1.7.1
type DirectoryTreeArgs struct {
Path string `json:"path" jsonschema:"The directory path to traverse"`
}
type EditFileArgs ¶ added in v1.7.1
type FetchResult ¶ added in v1.6.0
type FetchTool ¶ added in v1.6.0
type FetchTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewFetchTool ¶ added in v1.6.0
func NewFetchTool(options ...FetchToolOption) *FetchTool
func (*FetchTool) Instructions ¶ added in v1.6.0
type FetchToolArgs ¶ added in v1.10.1
type FetchToolOption ¶ added in v1.6.0
type FetchToolOption func(*FetchTool)
func WithTimeout ¶ added in v1.6.0
func WithTimeout(timeout time.Duration) FetchToolOption
type FileSystemOpt ¶
type FileSystemOpt func(*FilesystemTool)
func WithIgnoreVCS ¶ added in v1.9.11
func WithIgnoreVCS(ignoreVCS bool) FileSystemOpt
func WithPostEditCommands ¶ added in v1.2.0
func WithPostEditCommands(postEditCommands []PostEditConfig) FileSystemOpt
type FilesystemTool ¶
type FilesystemTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewFilesystemTool ¶
func NewFilesystemTool(allowedDirectories []string, opts ...FileSystemOpt) *FilesystemTool
func (*FilesystemTool) Instructions ¶
func (t *FilesystemTool) Instructions() string
type HandoffArgs ¶ added in v1.9.20
type HandoffArgs struct {
Agent string `json:"agent" jsonschema:"The name of the agent to hand off the conversation to."`
}
type HandoffTool ¶ added in v1.9.20
type HandoffTool struct {
tools.BaseToolSet
}
func NewHandoffTool ¶ added in v1.9.20
func NewHandoffTool() *HandoffTool
type ListDirectoryArgs ¶ added in v1.7.1
type ListDirectoryArgs struct {
Path string `json:"path" jsonschema:"The directory path to list"`
}
type ListDirectoryMeta ¶ added in v1.15.3
type MemoryTool ¶
type MemoryTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewMemoryTool ¶
func NewMemoryTool(manager DB) *MemoryTool
func (*MemoryTool) Instructions ¶
func (t *MemoryTool) Instructions() string
type PostEditConfig ¶ added in v1.2.0
type PostEditConfig struct {
Path string // File path pattern (glob-style)
Cmd string // Command to execute (with $path placeholder)
}
PostEditConfig represents a post-edit command configuration
type QueryRAGArgs ¶ added in v1.9.16
type QueryRAGArgs struct {
Query string `json:"query" jsonschema:"Search query"`
}
type QueryResult ¶ added in v1.9.16
type QueryResult struct {
SourcePath string `json:"source_path" jsonschema:"Path to the source document"`
Content string `json:"content" jsonschema:"Relevant document chunk content"`
Similarity float64 `json:"similarity" jsonschema:"Similarity score (0-1)"`
ChunkIndex int `json:"chunk_index" jsonschema:"Index of the chunk within the source document"`
}
type RAGTool ¶ added in v1.9.16
type RAGTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
RAGTool provides document querying capabilities for a single RAG source
func NewRAGTool ¶ added in v1.9.16
NewRAGTool creates a new RAG tool for a single RAG manager toolName is the name to use for the tool (typically from config or manager name)
func (*RAGTool) Instructions ¶ added in v1.9.16
type ReadFileArgs ¶ added in v1.7.1
type ReadFileArgs struct {
Path string `json:"path" jsonschema:"The file path to read"`
}
type ReadFileMeta ¶ added in v1.15.7
type ReadMultipleFilesArgs ¶ added in v1.7.1
type ReadMultipleFilesMeta ¶ added in v1.15.3
type ReadMultipleFilesMeta struct {
Files []ReadFileMeta `json:"files"`
}
type RunShellArgs ¶ added in v1.7.1
type RunShellArgs struct {
Cmd string `json:"cmd" jsonschema:"The shell command to execute"`
Cwd string `json:"cwd,omitempty" jsonschema:"The working directory to execute the command in (default: \".\")"`
Timeout int `json:"timeout,omitempty" jsonschema:"Command execution timeout in seconds (default: 30)"`
}
type RunShellBackgroundArgs ¶ added in v1.9.14
type ScriptShellTool ¶
type ScriptShellTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewScriptShellTool ¶
func NewScriptShellTool(shellTools map[string]latest.ScriptShellToolConfig, env []string) (*ScriptShellTool, error)
func (*ScriptShellTool) Instructions ¶
func (t *ScriptShellTool) Instructions() string
type SearchFilesArgs ¶ added in v1.0.0
type SearchFilesContentArgs ¶ added in v1.7.1
type SearchFilesContentArgs struct {
Path string `json:"path" jsonschema:"The starting directory path"`
Query string `json:"query" jsonschema:"The text or regex pattern to search for"`
IsRegex bool `json:"is_regex,omitempty" jsonschema:"If true, treat query as regex; otherwise literal text"`
ExcludePatterns []string `json:"excludePatterns,omitempty" jsonschema:"Patterns to exclude from search"`
}
type SearchToolArgs ¶ added in v1.9.24
type SearchToolArgs struct {
Query string `json:"query" jsonschema:"Search query to find tools by name or description (case-insensitive)"`
}
type SearchToolResult ¶ added in v1.9.24
type ShellTool ¶
type ShellTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewShellTool ¶
func NewShellTool(env []string, runConfig *config.RuntimeConfig) *ShellTool
func (*ShellTool) Instructions ¶
type StopBackgroundJobArgs ¶ added in v1.9.14
type StopBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"The ID of the background job to stop"`
}
type ThinkArgs ¶ added in v1.7.1
type ThinkArgs struct {
Thought string `json:"thought" jsonschema:"The thought to think about"`
}
type ThinkTool ¶
type ThinkTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewThinkTool ¶
func NewThinkTool() *ThinkTool
func (*ThinkTool) Instructions ¶
type TodoTool ¶
type TodoTool struct {
tools.BaseToolSet
// contains filtered or unexported fields
}
func NewTodoTool ¶
func NewTodoTool() *TodoTool
func (*TodoTool) Instructions ¶
type TransferTaskArgs ¶ added in v1.7.1
type TransferTaskArgs struct {
Agent string `json:"agent" jsonschema:"The name of the agent to transfer the task to."`
Task string `json:"task" jsonschema:"A clear and concise description of the task the member should achieve."`
ExpectedOutput string `json:"expected_output" jsonschema:"The expected output from the member (optional)."`
}
type TransferTaskTool ¶
type TransferTaskTool struct {
tools.BaseToolSet
}
func NewTransferTaskTool ¶
func NewTransferTaskTool() *TransferTaskTool
type UpdateTodoArgs ¶ added in v1.7.1
type ViewBackgroundJobArgs ¶ added in v1.9.14
type ViewBackgroundJobArgs struct {
JobID string `json:"job_id" jsonschema:"The ID of the background job to view"`
}
type WriteFileArgs ¶ added in v1.7.1
Click to show internal directories.
Click to hide internal directories.