Documentation
¶
Index ¶
- Variables
- func ExecuteToolCalls(calls []api.ToolCall, available []api.ToolSpec, ...) ([]api.ToolResult, error)
- func ExecuteWithConfirmations(toolCalls []api.ToolCall, confirmations []api.ToolConfirmation, ...) ([]api.ToolResult, bool, error)
- func RequestCompletion(ctx context.Context, params api.RequestParameters, messages []api.Message, ...)
Constants ¶
This section is empty.
Variables ¶
var BuiltinTools map[string]api.ToolSpec = map[string]api.ToolSpec{ "Read": toolbox.ReadFileTool, "Edit": toolbox.ModifyFile, "Write": toolbox.WriteFileTool, "Grep": toolbox.GrepTool, "Glob": toolbox.GlobTool, "Bash": toolbox.BashTool, "Python": toolbox.PythonTool, }
Functions ¶
func ExecuteToolCalls ¶
func ExecuteToolCalls(calls []api.ToolCall, available []api.ToolSpec, sandboxCfg *sandbox.ToolSandboxConfig) ([]api.ToolResult, error)
ExecuteToolCalls executes each of the provided api.ToolCalls by shelling out to `lmcli tool <name> <json>`, returning api.ToolResults. When sandboxCfg is non-nil and enabled, each invocation is wrapped in bwrap.
func ExecuteWithConfirmations ¶ added in v0.6.0
func ExecuteWithConfirmations( toolCalls []api.ToolCall, confirmations []api.ToolConfirmation, toolbox []api.ToolSpec, sandboxCfg *sandbox.ToolSandboxConfig, ) ([]api.ToolResult, bool, error)
ExecuteWithConfirmations executes approved tool calls and builds rejection results for unapproved ones, returning results in original tool call order. Returns true if all tools were rejected.
func RequestCompletion ¶ added in v0.6.0
func RequestCompletion( ctx context.Context, params api.RequestParameters, messages []api.Message, events chan<- api.Event, )
RequestCompletion runs a single completion step: one LLM call, streaming chunks and delivering the final response (which may contain tool calls) on the events channel. The events channel is closed when the step ends. Cancelling ctx stops the step at the earliest opportunity.
Tool execution and iteration are handled by the caller.
Types ¶
This section is empty.