PtcRunner.SubAgent.SubAgentTool (PtcRunner v0.4.1)
View SourceWraps a SubAgent as a callable tool for parent agents.
Created via SubAgent.as_tool/2, this struct allows agents to be
composed and nested. When a parent agent calls a SubAgentTool,
the wrapped agent executes with inherited LLM and registry.
LLM Resolution Order
When a SubAgentTool is called, the LLM is resolved in this priority order:
agent.llm- Agent's own LLM override (highest priority)bound_llm- LLM bound at tool creation viaas_tool/2- Parent's llm - Inherited from the calling agent at call time (lowest priority)
This allows flexible composition where child agents can use their own LLM, inherit from the parent, or use a specifically bound LLM.
Fields
agent- TheSubAgent.t()to wrap as a toolbound_llm- Optional LLM (atom or function) bound at tool creationsignature- Type signature (copied from agent.signature)description- Optional description (defaults to agent's prompt)