From b9735b2193267645781b268231d63c23c6fec654 Mon Sep 17 00:00:00 2001 From: Bastien Jacot-Guillarmod Date: Mon, 15 Sep 2025 03:06:25 -0700 Subject: [PATCH] docs: Correct the documentation of `after_agent_callback` The `after_agent_callback` in plugin works similarly as the `after_agent_callback` in `base_agent.py`, e.g. it only append new content, but cannot modify the previous content. PiperOrigin-RevId: 807162139 --- src/google/adk/plugins/base_plugin.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/google/adk/plugins/base_plugin.py b/src/google/adk/plugins/base_plugin.py index c35c08f6..a38152d8 100644 --- a/src/google/adk/plugins/base_plugin.py +++ b/src/google/adk/plugins/base_plugin.py @@ -211,17 +211,14 @@ class BasePlugin(ABC): ) -> Optional[types.Content]: """Callback executed after an agent's primary logic has completed. - This callback can be used to inspect, log, or modify the agent's final - result before it is returned. - Args: agent: The agent that has just run. callback_context: The context for the agent invocation. Returns: - An optional `types.Content` object. If a value is returned, it will - replace the agent's original result. Returning `None` uses the original, - unmodified result. + An optional `types.Content` object. The content to return to the user. + When the content is present, the provided content will be used as agent + response and appended to event history as agent response. """ pass