@@ -45,11 +45,13 @@ class AgentTool(BaseTool):
45
45
Attributes:
46
46
agent: The agent to wrap.
47
47
skip_summarization: Whether to skip summarization of the agent output.
48
+ include_plugins: Whether to include plugins from parent runner context
48
49
"""
49
50
50
- def __init__ (self , agent : BaseAgent , skip_summarization : bool = False ):
51
+ def __init__ (self , agent : BaseAgent , skip_summarization : bool = False , include_plugins : bool = False ):
51
52
self .agent = agent
52
53
self .skip_summarization : bool = skip_summarization
54
+ self .include_plugins = include_plugins
53
55
54
56
super ().__init__ (name = agent .name , description = agent .description )
55
57
@@ -125,13 +127,15 @@ async def run_async(
125
127
role = 'user' ,
126
128
parts = [types .Part .from_text (text = args ['request' ])],
127
129
)
130
+ plugins = self .agent .root_agent if self .include_plugins else None
128
131
runner = Runner (
129
132
app_name = self .agent .name ,
130
133
agent = self .agent ,
131
134
artifact_service = ForwardingArtifactService (tool_context ),
132
135
session_service = InMemorySessionService (),
133
136
memory_service = InMemoryMemoryService (),
134
137
credential_service = tool_context ._invocation_context .credential_service ,
138
+ plugins = plugins
135
139
)
136
140
session = await runner .session_service .create_session (
137
141
app_name = self .agent .name ,
0 commit comments