Documentation
¶
Index ¶
- Constants
- func GetContextValues(ctx context.Context) (string, string)
- type BaseTool
- func NewBashTool(permission permission.Service) BaseTool
- func NewDiagnosticsTool(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 NewSourcegraphTool() BaseTool
- func NewViewTool(lspClients map[string]*lsp.Client) BaseTool
- func NewWriteTool(lspClients map[string]*lsp.Client, permissions permission.Service, ...) BaseTool
- type BashParams
- type BashPermissionsParams
- type BashResponseMetadata
- type DiagnosticsParams
- 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 SourcegraphParams
- type SourcegraphResponseMetadata
- type ToolCall
- type ToolInfo
- type ToolResponse
- type TreeNode
- type ViewParams
- type ViewResponseMetadata
- 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 ( 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 (
DiagnosticsToolName = "diagnostics"
)
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 (
SourcegraphToolName = "sourcegraph"
)
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 NewEditTool ¶
func NewFetchTool ¶
func NewFetchTool(permissions permission.Service) BaseTool
func NewGlobTool ¶
func NewGlobTool() BaseTool
func NewGrepTool ¶
func NewGrepTool() BaseTool
func NewPatchTool ¶
func NewSourcegraphTool ¶
func NewSourcegraphTool() BaseTool
func NewWriteTool ¶
type BashParams ¶
type BashPermissionsParams ¶
type BashResponseMetadata ¶
type DiagnosticsParams ¶
type DiagnosticsParams 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 SourcegraphParams ¶
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 WriteParams ¶
type WritePermissionsParams ¶
type WriteResponseMetadata ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.