From 541d12328e9bfacf1efc45a16c0580fc38238266 Mon Sep 17 00:00:00 2001 From: Harsh Jha Date: Thu, 12 Feb 2026 20:36:27 +0530 Subject: [PATCH] chore: made changes to align with sdk repo --- docs/en/sdks/python-sdk/adk/index.md | 37 ++-------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/docs/en/sdks/python-sdk/adk/index.md b/docs/en/sdks/python-sdk/adk/index.md index 761cfa3942..12430ed734 100644 --- a/docs/en/sdks/python-sdk/adk/index.md +++ b/docs/en/sdks/python-sdk/adk/index.md @@ -1,5 +1,5 @@ --- -title: "Adk" +title: "ADK" type: docs weight: 8 description: > @@ -21,7 +21,7 @@ pip install google-adk[toolbox] The primary entry point is the `ToolboxToolset`, which loads tools from a remote Toolbox server and adapts them for use with ADK agents. {{< notice note>}} -> This package contains the core implementation of the `ToolboxToolset`. The `ToolboxToolset` provided in the [`google-adk`](https://github.com/google/adk-python/blob/758d337c76d877e3174c35f06551cc9beb1def06/src/google/adk/tools/toolbox_toolset.py#L35) package is a shim that simply delegates all functionality to this implementation. +This package contains the core implementation of the `ToolboxToolset`. The `ToolboxToolset` provided in the [`google-adk`](https://github.com/google/adk-python/blob/758d337c76d877e3174c35f06551cc9beb1def06/src/google/adk/tools/toolbox_toolset.py#L35) package is a shim that simply delegates all functionality to this implementation. {{< /notice >}} ```python @@ -244,36 +244,3 @@ toolset = ToolboxToolset( } ) ``` - -### Usage with Hooks - -You can attach `pre_hook` and `post_hook` functions to execute logic before and after every tool invocation. - -{{< notice note>}} - The `pre_hook` can modify `context.arguments` to dynamically alter the inputs passed to the tool. -{{< /notice >}} - -```python -from google.adk.tools.tool_context import ToolContext -from typing import Any, Dict, Optional - -async def log_start(context: ToolContext, args: Dict[str, Any]): - print(f"Starting tool with args: {args}") - # context is the ADK ToolContext - # Example: Inject or modify arguments - # args["user_id"] = "123" - -async def log_end(context: ToolContext, args: Dict[str, Any], result: Optional[Any], error: Optional[Exception]): - print("Finished tool execution") - # Inspect result or error - if error: - print(f"Tool failed: {error}") - else: - print(f"Tool succeeded with result: {result}") - -toolset = ToolboxToolset( - server_url="...", - pre_hook=log_start, - post_hook=log_end -) -``` \ No newline at end of file