Documentation
¶
Index ¶
- Constants
- func GetContextValues(ctx context.Context) (string, string)
- type BaseTool
- func NewBashTool(permission permission.Service) BaseTool
- func NewBatchTool(tools map[string]BaseTool) BaseTool
- func NewCodeActionTool(lspClients map[string]*lsp.Client) BaseTool
- func NewDefinitionTool(lspClients map[string]*lsp.Client) BaseTool
- func NewDiagnosticsTool(lspClients map[string]*lsp.Client) BaseTool
- func NewDocSymbolsTool(lspClients map[string]*lsp.Client) BaseTool
- func NewEditTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewFetchTool(permissions permission.Service) BaseTool
- func NewGlobTool() BaseTool
- func NewGrepTool() BaseTool
- func NewLsTool() BaseTool
- func NewPatchTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- func NewReferencesTool(lspClients map[string]*lsp.Client) BaseTool
- func NewViewTool(lspClients map[string]*lsp.Client) BaseTool
- func NewWorkspaceSymbolsTool(lspClients map[string]*lsp.Client) BaseTool
- func NewWriteTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- type BashParams
- type BashPermissionsParams
- type BashResponseMetadata
- type BatchParams
- type BatchResult
- type BatchToolCall
- type BatchToolResult
- type CodeActionParams
- type DefinitionParams
- type DiagnosticsParams
- type DocSymbolsParams
- type EditParams
- type EditPermissionsParams
- type EditResponseMetadata
- type FetchParams
- type FetchPermissionsParams
- type GlobParams
- type GlobResponseMetadata
- type GrepParams
- type GrepResponseMetadata
- type LSParams
- type LSResponseMetadata
- type LineScanner
- type PatchParams
- type PatchResponseMetadata
- type ReferencesParams
- type SymbolInfo
- type ToolCall
- type ToolInfo
- type ToolResponse
- type TreeNode
- type ViewParams
- type ViewResponseMetadata
- type WorkspaceSymbolsParams
- type WriteParams
- type WritePermissionsParams
- type WriteResponseMetadata
Constants ¶
View Source
const ( BashToolName = "bash" DefaultTimeout = 1 * 60 * 1000 // 1 minutes in milliseconds MaxTimeout = 10 * 60 * 1000 // 10 minutes in milliseconds MaxOutputLength = 30000 )
View Source
const ( BatchToolName = "batch" BatchToolDescription = `` /* 1029-byte string literal not displayed */ )
View Source
const ( LSToolName = "ls" MaxLSFiles = 1000 )
View Source
const ( ToolResponseTypeText toolResponseType = "text" ToolResponseTypeImage toolResponseType = "image" SessionIDContextKey sessionIDContextKey = "session_id" MessageIDContextKey messageIDContextKey = "message_id" )
View Source
const ( ViewToolName = "view" MaxReadSize = 250 * 1024 DefaultReadLimit = 2000 MaxLineLength = 2000 )
View Source
const (
CodeActionToolName = "codeAction"
)
View Source
const (
DefinitionToolName = "definition"
)
View Source
const (
DiagnosticsToolName = "diagnostics"
)
View Source
const (
DocSymbolsToolName = "docSymbols"
)
View Source
const (
EditToolName = "edit"
)
View Source
const (
FetchToolName = "fetch"
)
View Source
const (
GlobToolName = "glob"
)
View Source
const (
GrepToolName = "grep"
)
View Source
const (
PatchToolName = "patch"
)
View Source
const (
ReferencesToolName = "references"
)
View Source
const (
WorkspaceSymbolsToolName = "workspaceSymbols"
)
View Source
const (
WriteToolName = "write"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseTool ¶
type BaseTool interface { Info() ToolInfo Run(ctx context.Context, params ToolCall) (ToolResponse, error) }
func NewBashTool ¶
func NewBashTool(permission permission.Service) BaseTool
func NewBatchTool ¶ added in v0.0.49
func NewEditTool ¶
func NewFetchTool ¶
func NewFetchTool(permissions permission.Service) BaseTool
func NewGlobTool ¶
func NewGlobTool() BaseTool
func NewGrepTool ¶
func NewGrepTool() BaseTool
func NewPatchTool ¶
func NewWorkspaceSymbolsTool ¶
func NewWriteTool ¶
type BashParams ¶
type BashPermissionsParams ¶
type BashResponseMetadata ¶
type BatchParams ¶ added in v0.0.49
type BatchParams struct {
Calls []BatchToolCall `json:"calls"`
}
type BatchResult ¶ added in v0.0.49
type BatchResult struct {
Results []BatchToolResult `json:"results"`
}
type BatchToolCall ¶ added in v0.0.49
type BatchToolCall struct { Name string `json:"name"` Input json.RawMessage `json:"input"` }
type BatchToolResult ¶ added in v0.0.49
type BatchToolResult struct { ToolName string `json:"tool_name"` ToolInput json.RawMessage `json:"tool_input"` Result json.RawMessage `json:"result"` Error string `json:"error,omitempty"` // Added for better formatting and separation between results Separator string `json:"separator,omitempty"` }
type CodeActionParams ¶
type DefinitionParams ¶
type DiagnosticsParams ¶
type DiagnosticsParams struct {
FilePath string `json:"file_path"`
}
type DocSymbolsParams ¶
type DocSymbolsParams struct {
FilePath string `json:"file_path"`
}
type EditParams ¶
type EditPermissionsParams ¶
type EditResponseMetadata ¶
type FetchParams ¶
type FetchPermissionsParams ¶
type GlobParams ¶
type GlobResponseMetadata ¶
type GrepParams ¶
type GrepResponseMetadata ¶
type LSResponseMetadata ¶
type LineScanner ¶
type LineScanner struct {
// contains filtered or unexported fields
}
func NewLineScanner ¶
func NewLineScanner(r io.Reader) *LineScanner
func (*LineScanner) Err ¶
func (s *LineScanner) Err() error
func (*LineScanner) Scan ¶
func (s *LineScanner) Scan() bool
func (*LineScanner) Text ¶
func (s *LineScanner) Text() string
type PatchParams ¶
type PatchParams struct {
PatchText string `json:"patch_text"`
}
type PatchResponseMetadata ¶
type ReferencesParams ¶
type SymbolInfo ¶
type SymbolInfo struct { Name string Kind string Location string Children []SymbolInfo }
SymbolInfo represents a symbol in a document
type ToolResponse ¶
type ToolResponse struct { Type toolResponseType `json:"type"` Content string `json:"content"` Metadata string `json:"metadata,omitempty"` IsError bool `json:"is_error"` }
func NewTextErrorResponse ¶
func NewTextErrorResponse(content string) ToolResponse
func NewTextResponse ¶
func NewTextResponse(content string) ToolResponse
func WithResponseMetadata ¶
func WithResponseMetadata(response ToolResponse, metadata any) ToolResponse
type ViewParams ¶
type ViewResponseMetadata ¶
type WorkspaceSymbolsParams ¶
type WorkspaceSymbolsParams struct {
Query string `json:"query"`
}
type WriteParams ¶
type WritePermissionsParams ¶
type WriteResponseMetadata ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.