From ff8b1ab37a73f0ba24e283780eb47ae2e4397cb3 Mon Sep 17 00:00:00 2001 From: Zyan Date: Tue, 21 Jul 2026 14:57:21 -0600 Subject: [PATCH 1/5] Update include_plugins per Issue #1173 - 9 Rendered page> PRs> #1190 #1192 Original Issue> #1173 - Changed the proposed note format into a bullet point. - Made the explanation shorter and more direct so it matches Google's writing style guide. - Fixed and replaced the undefined agent variable with a concrete MyImageAgent placeholder class to make the Python snippet self-contained. - Added comments inside the code to explain exactly what happens when you turn plugins on or off (like how it affects things like tracing and events). - Did light formatting in the rest of the page --- docs/tools-custom/function-tools.md | 39 ++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/tools-custom/function-tools.md b/docs/tools-custom/function-tools.md index 8291c74274..c44ef69e7b 100644 --- a/docs/tools-custom/function-tools.md +++ b/docs/tools-custom/function-tools.md @@ -751,11 +751,48 @@ To use an agent as a tool, wrap the agent with the `AgentTool` class. AgentTool(agent = agentB) ``` -### Customization +### Customize your agent tool The `AgentTool` class provides the following attributes for customizing its behavior: +- **include_plugins**: (boolean) If set to True, the child agent inherits all plugins + from the parent. If set to False, the child agent runs in an isolated environment + without inheriting any plugins from the parent. Use this setting to ensure an + agent's execution is self-contained and unaffected by the parent's + plugin environment. + +??? "Example" + +=== "Python" + +```python + from google.adk.tools import agent_tool + + # Placeholder definition for MyImageAgent + class MyImageAgent: + def __init__( + self, name="My Agent", description="A simple image agent." + ): + self.name = name + # Added description attribute + self.description = description + + # Example 1: Isolate MyImageAgent from parent plugins + # (blocks inherited observability) + my_isolated_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=False + ) + + # Example 2: Inherit plugins (Default behavior, preserves trace + # spans and event streaming) + my_observable_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=True + ) + ``` + - **skip_summarization** (Python/TypeScript) / **skipSummarization** (Kotlin/Java): (boolean) If set to True, the framework will **bypass the LLM-based summarization** of the tool agent's response. This can be useful From 8f3e26d2e081ed2de1b44518a70b6a2a85aa3785 Mon Sep 17 00:00:00 2001 From: Zyan Date: Tue, 21 Jul 2026 15:09:10 -0600 Subject: [PATCH 2/5] Update function-tools.md --- docs/tools-custom/function-tools.md | 51 +++++++++++++---------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/docs/tools-custom/function-tools.md b/docs/tools-custom/function-tools.md index c44ef69e7b..a45a8a56a5 100644 --- a/docs/tools-custom/function-tools.md +++ b/docs/tools-custom/function-tools.md @@ -762,36 +762,29 @@ behavior: agent's execution is self-contained and unaffected by the parent's plugin environment. -??? "Example" - -=== "Python" - ```python - from google.adk.tools import agent_tool - - # Placeholder definition for MyImageAgent - class MyImageAgent: - def __init__( - self, name="My Agent", description="A simple image agent." - ): - self.name = name - # Added description attribute - self.description = description - - # Example 1: Isolate MyImageAgent from parent plugins - # (blocks inherited observability) - my_isolated_tool = agent_tool.AgentTool( - agent=MyImageAgent(), # Instantiate MyImageAgent - include_plugins=False - ) - - # Example 2: Inherit plugins (Default behavior, preserves trace - # spans and event streaming) - my_observable_tool = agent_tool.AgentTool( - agent=MyImageAgent(), # Instantiate MyImageAgent - include_plugins=True - ) - ``` +from google.adk.tools import agent_tool + +# Placeholder definition for MyImageAgent +class MyImageAgent: + def __init__(self, name="My Agent", description="A simple image agent."): + self.name = name + self.description = description # Added description attribute + +# Example 1: Isolate MyImageAgent from parent plugins +# (blocks inherited observability) +my_isolated_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=False +) + +# Example 2: Inherit plugins (Default behavior, preserves trace spans +# and event streaming) +my_observable_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=True +) + ``` - **skip_summarization** (Python/TypeScript) / **skipSummarization** (Kotlin/Java): (boolean) If set to True, the framework will **bypass the From d755b19d99ac8ede55a6b3bd2d15307d104f4c74 Mon Sep 17 00:00:00 2001 From: Zyan Date: Tue, 21 Jul 2026 15:18:13 -0600 Subject: [PATCH 3/5] Update function-tools.md fixed rendering mistakes --- docs/tools-custom/function-tools.md | 60 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/tools-custom/function-tools.md b/docs/tools-custom/function-tools.md index a45a8a56a5..74b75c90a2 100644 --- a/docs/tools-custom/function-tools.md +++ b/docs/tools-custom/function-tools.md @@ -756,36 +756,6 @@ To use an agent as a tool, wrap the agent with the `AgentTool` class. The `AgentTool` class provides the following attributes for customizing its behavior: -- **include_plugins**: (boolean) If set to True, the child agent inherits all plugins - from the parent. If set to False, the child agent runs in an isolated environment - without inheriting any plugins from the parent. Use this setting to ensure an - agent's execution is self-contained and unaffected by the parent's - plugin environment. - -```python -from google.adk.tools import agent_tool - -# Placeholder definition for MyImageAgent -class MyImageAgent: - def __init__(self, name="My Agent", description="A simple image agent."): - self.name = name - self.description = description # Added description attribute - -# Example 1: Isolate MyImageAgent from parent plugins -# (blocks inherited observability) -my_isolated_tool = agent_tool.AgentTool( - agent=MyImageAgent(), # Instantiate MyImageAgent - include_plugins=False -) - -# Example 2: Inherit plugins (Default behavior, preserves trace spans -# and event streaming) -my_observable_tool = agent_tool.AgentTool( - agent=MyImageAgent(), # Instantiate MyImageAgent - include_plugins=True -) - ``` - - **skip_summarization** (Python/TypeScript) / **skipSummarization** (Kotlin/Java): (boolean) If set to True, the framework will **bypass the LLM-based summarization** of the tool agent's response. This can be useful @@ -832,6 +802,36 @@ my_observable_tool = agent_tool.AgentTool( ```kotlin --8<-- "examples/kotlin/snippets/tools/function-tools/AgentTool.kt:agent_tool" ``` + +- **include_plugins**: (boolean) If set to True, the child agent inherits all plugins + from the parent. If set to False, the child agent runs in an isolated environment + without inheriting any plugins from the parent. Use this setting to ensure an + agent's execution is self-contained and unaffected by the parent's + plugin environment. + +```python +from google.adk.tools import agent_tool + +# Placeholder definition for MyImageAgent +class MyImageAgent: + def __init__(self, name="My Agent", description="A simple image agent."): + self.name = name + self.description = description # Added description attribute + +# Example 1: Isolate MyImageAgent from parent plugins +# (blocks inherited observability) +my_isolated_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=False +) + +# Example 2: Inherit plugins (Default behavior, preserves trace spans +# and event streaming) +my_observable_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=True +) + ``` ### How it works From a005f71bb1651269225f001a7ef1ff6fe0c1b9f2 Mon Sep 17 00:00:00 2001 From: Zyan Date: Tue, 21 Jul 2026 15:37:03 -0600 Subject: [PATCH 4/5] Update function-tools.md Adding a bullet did not work, I created a sub topic to stop the snippet from breaking in the rendering. --- docs/tools-custom/function-tools.md | 74 +++++++++++++++++------------ 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/docs/tools-custom/function-tools.md b/docs/tools-custom/function-tools.md index 74b75c90a2..c3945b5654 100644 --- a/docs/tools-custom/function-tools.md +++ b/docs/tools-custom/function-tools.md @@ -803,37 +803,7 @@ behavior: --8<-- "examples/kotlin/snippets/tools/function-tools/AgentTool.kt:agent_tool" ``` -- **include_plugins**: (boolean) If set to True, the child agent inherits all plugins - from the parent. If set to False, the child agent runs in an isolated environment - without inheriting any plugins from the parent. Use this setting to ensure an - agent's execution is self-contained and unaffected by the parent's - plugin environment. - -```python -from google.adk.tools import agent_tool - -# Placeholder definition for MyImageAgent -class MyImageAgent: - def __init__(self, name="My Agent", description="A simple image agent."): - self.name = name - self.description = description # Added description attribute - -# Example 1: Isolate MyImageAgent from parent plugins -# (blocks inherited observability) -my_isolated_tool = agent_tool.AgentTool( - agent=MyImageAgent(), # Instantiate MyImageAgent - include_plugins=False -) - -# Example 2: Inherit plugins (Default behavior, preserves trace spans -# and event streaming) -my_observable_tool = agent_tool.AgentTool( - agent=MyImageAgent(), # Instantiate MyImageAgent - include_plugins=True -) - ``` - -### How it works +#### How it works 1. When the `root_agent` receives the long text, its instruction tells it to use the 'summarize' tool for long texts. @@ -847,3 +817,45 @@ my_observable_tool = agent_tool.AgentTool( `root_agent`.** 6. The `root_agent` can then take the summary and formulate its final response to the user (e.g., "Here's a summary of the text: ...") + +#### Control plugin inheritance + +When you wrap an agent with `AgentTool`, you can control whether it +inherits plugins from the parent runner using the `include_plugins` +parameter. + +* **`include_plugins=True` (default):** The child agent inherits all + plugins from the parent. +* **`include_plugins=False`:** The child agent runs in an isolated + environment without inheriting any plugins from the parent. Use this + setting to ensure an agent's execution is self-contained and unaffected + by the parent's plugin environment. + +=== "Python" + + ```python + from google.adk.tools import agent_tool + + # Placeholder definition for MyImageAgent + class MyImageAgent: + def __init__( + self, name="My Agent", description="A simple image agent." + ): + self.name = name + # Added description attribute + self.description = description + + # Example 1: Isolate MyImageAgent from parent plugins + # (blocks inherited observability) + my_isolated_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=False + ) + + # Example 2: Inherit plugins (Default behavior, preserves trace + # spans and event streaming) + my_observable_tool = agent_tool.AgentTool( + agent=MyImageAgent(), # Instantiate MyImageAgent + include_plugins=True + ) + ``` From 2a330a72442cd1fa2f8392954ac020f05d04d354 Mon Sep 17 00:00:00 2001 From: Zyan Date: Tue, 28 Jul 2026 16:27:52 -0600 Subject: [PATCH 5/5] Update function-tools.md --- docs/tools-custom/function-tools.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/tools-custom/function-tools.md b/docs/tools-custom/function-tools.md index c3945b5654..1c10a7b63b 100644 --- a/docs/tools-custom/function-tools.md +++ b/docs/tools-custom/function-tools.md @@ -804,7 +804,6 @@ behavior: ``` #### How it works - 1. When the `root_agent` receives the long text, its instruction tells it to use the 'summarize' tool for long texts. 2. The framework recognizes 'summarize' as an `AgentTool` that wraps the @@ -825,7 +824,7 @@ inherits plugins from the parent runner using the `include_plugins` parameter. * **`include_plugins=True` (default):** The child agent inherits all - plugins from the parent. + plugins from the parent, preserving trace spans and event streaming. * **`include_plugins=False`:** The child agent runs in an isolated environment without inheriting any plugins from the parent. Use this setting to ensure an agent's execution is self-contained and unaffected @@ -846,14 +845,12 @@ parameter. self.description = description # Example 1: Isolate MyImageAgent from parent plugins - # (blocks inherited observability) my_isolated_tool = agent_tool.AgentTool( agent=MyImageAgent(), # Instantiate MyImageAgent include_plugins=False ) - # Example 2: Inherit plugins (Default behavior, preserves trace - # spans and event streaming) + # Example 2: Inherit plugins my_observable_tool = agent_tool.AgentTool( agent=MyImageAgent(), # Instantiate MyImageAgent include_plugins=True