From 11ca52809063bde64f5b9fbce577cae3752695b9 Mon Sep 17 00:00:00 2001 From: Jack Wotherspoon Date: Fri, 16 May 2025 13:56:21 -0700 Subject: [PATCH] feat!: remove ToolboxTool in favor of using toolbox-core directly Copybara import of the project: -- 9cefcdde97685bc6966a13019bfb80cc232a399b by Jack Wotherspoon : chore: delete toolbox_tool.py -- b2607eb0397e72b6b616ac592920f74d42a8ee5d by jackwotherspoon : feat: expose toolbox -- a4a0859997af9a68e240f78ff351f0fded6a52e2 by Jack Wotherspoon : chore: update formatting -- 070dc93cdc289a5ee5935bd5995d3005bf8396a0 by jackwotherspoon : chore: add base toolbox tests -- ab84a0f49eccc9b993317b3ffe2b5b6cad278d70 by jackwotherspoon : chore: remove ToolboxTool -- 87f4f909acc294468bcb3053e300f4df252bdb27 by Jack Wotherspoon : chore: update formatting -- ddc1a11c0ce45fe34e5f2dd43c808d88a7d6af0b by Jack Wotherspoon : chore: Update pyproject.toml -- aee173d8df40ffefe535b266e1bd6528c9aeb1b9 by Jack Wotherspoon : chore: Update pyproject.toml -- 22fc95922b500ddb0ec4901dccbe2fbfcc53b35f by Jack Wotherspoon : chore: Update __init__.py COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/763 from jackwotherspoon:expose-toolbox 3cb629a9d0d18aaeeeed59fb0d0d1e1b225b7437 PiperOrigin-RevId: 759744557 --- src/google/adk/tools/toolbox_tool.py | 45 ---------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/google/adk/tools/toolbox_tool.py diff --git a/src/google/adk/tools/toolbox_tool.py b/src/google/adk/tools/toolbox_tool.py deleted file mode 100644 index e0a1ed8..0000000 --- a/src/google/adk/tools/toolbox_tool.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from typing import Any - -from .langchain_tool import LangchainTool - - -class ToolboxTool: - """A class that provides access to toolbox tools. - - Example: - ```python - toolbox = ToolboxTool("http://127.0.0.1:5000") - tool = toolbox.get_tool("tool_name") - toolset = toolbox.get_toolset("toolset_name") - ``` - """ - - toolbox_client: Any - """The toolbox client.""" - - def __init__(self, url: str): - from toolbox_langchain import ToolboxClient - - self._toolbox_client = ToolboxClient(url) - - def get_tool(self, tool_name: str) -> LangchainTool: - tool = self._toolbox_client.load_tool(tool_name) - return LangchainTool(tool) - - def get_toolset(self, toolset_name: str) -> list[LangchainTool]: - tools = self._toolbox_client.load_toolset(toolset_name) - return [LangchainTool(tool) for tool in tools]