Documentation
¶
Overview ¶
Package agenttool provides a tool that allows an agent to call another agent. This enables composition of agents (Pattern 2: agent-as-tool delegation).
This follows adk-go's agenttool pattern exactly:
- Tool name matches agent name (not prefixed with "call_")
- Child agent runs in isolated session (no state bleeding)
- Parent state is copied to child (filtered for internal keys)
Example:
searchAgent, _ := llmagent.New(llmagent.Config{...})
analysisAgent, _ := llmagent.New(llmagent.Config{...})
rootAgent, _ := llmagent.New(llmagent.Config{
Tools: []tool.Tool{
agenttool.New(searchAgent, nil), // ✅ adk-go aligned pattern
agenttool.New(analysisAgent, nil),
},
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new agent tool that wraps the given agent. This enables Pattern 2 (agent-as-tool delegation) where the parent agent maintains control and receives structured results from the child agent.
If cfg is nil, default configuration is used (skipSummarization = false).
The child agent runs in an ISOLATED session (adk-go pattern), meaning:
- Child has its own session state
- Parent state is copied at invocation time (excluding internal keys)
- State changes in child do NOT affect parent session
Types ¶
Click to show internal directories.
Click to hide internal directories.