Documentation
¶
Index ¶
- func AllTools() []provider.ToolDefinition
- func DetectVerifyCommand(workDir string) string
- func FileReadTool() provider.ToolDefinition
- func FileWriteTool() provider.ToolDefinition
- func RunVerification(ctx context.Context, command string, workDir string, timeout time.Duration) (output string, success bool, err error)
- func ShellExecTool() provider.ToolDefinition
- type ConfirmFunc
- type Executor
- type ToolLoop
- type ToolResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllTools ¶
func AllTools() []provider.ToolDefinition
AllTools returns all available tool definitions.
func DetectVerifyCommand ¶ added in v0.2.0
DetectVerifyCommand auto-detects the appropriate test/verify command for the project in the given working directory.
func FileReadTool ¶
func FileReadTool() provider.ToolDefinition
FileReadTool returns a ToolDefinition for reading files.
func FileWriteTool ¶
func FileWriteTool() provider.ToolDefinition
FileWriteTool returns a ToolDefinition for writing files.
func RunVerification ¶ added in v0.2.0
func RunVerification(ctx context.Context, command string, workDir string, timeout time.Duration) (output string, success bool, err error)
RunVerification executes a verification command and returns the output and whether it succeeded.
func ShellExecTool ¶
func ShellExecTool() provider.ToolDefinition
ShellExecTool returns a ToolDefinition for executing shell commands.
Types ¶
type ConfirmFunc ¶
ConfirmFunc is a callback that asks the user to confirm an action. It receives a human-readable description and returns true if the user approves.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor dispatches tool calls to the appropriate handler.
func NewExecutor ¶
func NewExecutor(confirm ConfirmFunc, cmdTimeout time.Duration) *Executor
NewExecutor creates an Executor with the given confirmation callback and command timeout for shell operations.
type ToolLoop ¶
type ToolLoop struct {
// contains filtered or unexported fields
}
ToolLoop manages the iterative cycle of executing tool calls and sending results back to the model until the model produces a final text response.
func NewToolLoop ¶
NewToolLoop creates a ToolLoop with the given executor and primary provider.
func (*ToolLoop) Run ¶
func (l *ToolLoop) Run( ctx context.Context, messages []provider.Message, toolCalls []provider.ToolCall, opts provider.QueryOpts, ) (<-chan provider.StreamChunk, error)
Run executes tool calls, appends results as messages, and re-queries the model. It repeats until the model stops issuing tool calls or the iteration limit is reached. It returns the final streaming response channel.
type ToolResult ¶
ToolResult holds the outcome of executing a single tool call.