Documentation
¶
Overview ¶
Package agenttool implements the AgentTool — the agent's way to spawn a nested sub-agent with a specific prompt.
When the model calls AgentTool, the tool:
- Builds a fresh user message from the supplied prompt.
- Runs a nested agent loop (same tools, same client, new history).
- Returns the sub-agent's final text response.
This mirrors AgentTool.tsx's core call() path (the non-team, non-remote, non-background case) — a synchronous forked sub-agent that returns its result text.
Reference: src/tools/AgentTool/AgentTool.tsx
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool implements the AgentTool.
func New ¶
New returns an AgentTool. runAgent is a closure that runs a nested agent loop with the given prompt as the sole user message and returns the final assistant text.
func (*Tool) Description ¶
func (*Tool) InputSchema ¶
func (*Tool) InputSchema() json.RawMessage
func (*Tool) IsConcurrencySafe ¶
func (*Tool) IsConcurrencySafe(json.RawMessage) bool
func (*Tool) IsReadOnly ¶
func (*Tool) IsReadOnly(json.RawMessage) bool
Click to show internal directories.
Click to hide internal directories.