mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-16 04:02:55 -06:00
feat!: remove ToolboxTool in favor of using toolbox-core directly
Copybara import of the project: -- 9cefcdde97685bc6966a13019bfb80cc232a399b by Jack Wotherspoon <jackwoth@google.com>: chore: delete toolbox_tool.py -- b2607eb0397e72b6b616ac592920f74d42a8ee5d by jackwotherspoon <jackwoth@google.com>: feat: expose toolbox -- a4a0859997af9a68e240f78ff351f0fded6a52e2 by Jack Wotherspoon <jackwoth@google.com>: chore: update formatting -- 070dc93cdc289a5ee5935bd5995d3005bf8396a0 by jackwotherspoon <jackwoth@google.com>: chore: add base toolbox tests -- ab84a0f49eccc9b993317b3ffe2b5b6cad278d70 by jackwotherspoon <jackwoth@google.com>: chore: remove ToolboxTool -- 87f4f909acc294468bcb3053e300f4df252bdb27 by Jack Wotherspoon <jackwoth@google.com>: chore: update formatting -- ddc1a11c0ce45fe34e5f2dd43c808d88a7d6af0b by Jack Wotherspoon <jackwoth@google.com>: chore: Update pyproject.toml -- aee173d8df40ffefe535b266e1bd6528c9aeb1b9 by Jack Wotherspoon <jackwoth@google.com>: chore: Update pyproject.toml -- 22fc95922b500ddb0ec4901dccbe2fbfcc53b35f by Jack Wotherspoon <jackwoth@google.com>: chore: Update __init__.py COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/763 from jackwotherspoon:expose-toolbox 3cb629a9d0d18aaeeeed59fb0d0d1e1b225b7437 PiperOrigin-RevId: 759744557
This commit is contained in:
parent
76116c8008
commit
11ca528090
@ -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]
|
|
Loading…
Reference in New Issue
Block a user