Documentation
¶
Overview ¶
Package task provides a tool that lets the LLM spawn one-shot subagent runs for complex or parallelizable subtasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Inputs ¶
type Inputs struct {
Description string `json:"description" jsonschema:"required,description=Short summary of the task (3-5 words)"`
Prompt string `json:"prompt" jsonschema:"required,description=Full task description for the subagent"`
Agent string `json:"agent,omitempty" jsonschema:"description=Agent type to use (omit for default)"`
}
Inputs defines the JSON schema for the Task tool parameters.
type RunFunc ¶
RunFunc is the callback that spawns a subagent run. The caller (wiring layer) provides this — it resolves the agent name to a Runner and calls Runner.Run.
type Tool ¶
type Tool struct {
tool.Base
// Run is set by the wiring layer after construction. Nil = tool returns an error.
Run RunFunc
// Agents lists available subagent types for the dynamic description.
Agents []AgentInfo
}
Tool lets the LLM delegate work to a subagent with isolated context.
func New ¶
New creates a Task tool with the given agent info. The Run callback must be set separately before the tool is usable.
func (*Tool) BuildDescription ¶
BuildDescription creates a dynamic tool description from available agents.
func (*Tool) Sandboxable ¶
Sandboxable returns false — the subagent manages its own sandbox.