Documentation
¶
Overview ¶
Package batch provides a meta-tool that executes multiple independent tool calls concurrently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inputs ¶
type Inputs struct {
Calls []SubCall `` /* 140-byte string literal not displayed */
}
Inputs defines the JSON schema for the Batch tool parameters.
type SubCall ¶
type SubCall struct {
Name string `json:"name" jsonschema:"required,description=Name of the tool to execute"`
Arguments map[string]any `json:"arguments" jsonschema:"required,description=Arguments for the tool"`
}
SubCall represents a single tool invocation within a batch.
type Tool ¶
type Tool struct {
tool.Base
// Run is set by the wiring layer after construction. Nil = tool returns an error.
Run RunFunc
// IsParallel reports whether a tool is safe for concurrent execution.
// When nil, all tools are dispatched concurrently (test compatibility).
// When set, tools returning false are executed sequentially after parallel ones complete.
IsParallel func(name string) bool
}
Tool lets the LLM dispatch multiple independent tool calls in parallel.
func New ¶
func New() *Tool
New creates a Batch tool. The Run callback must be set separately before the tool is usable.
func (*Tool) Execute ¶
Execute validates input, dispatches sub-calls with a two-pass pattern: parallel-safe tools run concurrently, then non-parallel tools run sequentially.
func (*Tool) Sandboxable ¶
Sandboxable returns false — sub-calls handle their own sandboxing individually.
Click to show internal directories.
Click to hide internal directories.