-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
models[Component] Issues related to model support[Component] Issues related to model support
Description
Describe the bug
- We are trying to create an
OpenAPIToolSet
from looker's OAS spec which is in v2.0. - The following error is raised when the runner invokes OAS parse; however we can't find any documentations saying which version
OpenAPIToolSet
is expecting or how to configure the version. - Is there any way we can workaround with the 2.0 OAS as a tool for adk agents ?
log
INFO: 127.0.0.1:52702 - "POST /run_sse HTTP/1.1" 200 OK
2025-05-31 15:56:52,355 - INFO - envs.py:47 - Loaded .env file for demo-looker-agent at /workspaces/EVERYTHING/joons/genai/google-chat-rag/demo-looker-agent/.env
2025-05-31 15:56:52,715 - ERROR - fast_api.py:817 - Error in event_generator: 'dict' object has no attribute 'description'
Traceback (most recent call last):
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 805, in event_generator
runner = await _get_runner_async(req.app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 978, in _get_runner_async
root_agent = await _get_root_agent_async(app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 963, in _get_root_agent_async
agent_module = importlib.import_module(app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/devuser/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/demo-looker-agent/__init__.py", line 1, in <module>
from . import root_agent as agent
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/demo-looker-agent/root_agent.py", line 7, in <module>
looker_toolset = OpenAPIToolset(
^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py", line 108, in __init__
self._tools: Final[List[RestApiTool]] = list(self._parse(spec_dict))
^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py", line 158, in _parse
operations = OpenApiSpecParser().parse(openapi_spec_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py", line 71, in parse
operations = self._collect_operations(openapi_spec_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py", line 120, in _collect_operations
operation_parser = OperationParser(operation)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/operation_parser.py", line 57, in __init__
self._process_operation_parameters()
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/operation_parser.py", line 84, in _process_operation_parameters
description if not schema.description else schema.description
^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'description'
2025-05-31 15:56:52,715 - ERROR - fast_api.py:817 - Error in event_generator: 'dict' object has no attribute 'description'
Traceback (most recent call last):
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 805, in event_generator
runner = await _get_runner_async(req.app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 978, in _get_runner_async
root_agent = await _get_root_agent_async(app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/cli/fast_api.py", line 963, in _get_root_agent_async
agent_module = importlib.import_module(app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/devuser/.local/share/uv/python/cpython-3.12.10-linux-x86_64-gnu/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/demo-looker-agent/__init__.py", line 1, in <module>
from . import root_agent as agent
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/demo-looker-agent/root_agent.py", line 7, in <module>
looker_toolset = OpenAPIToolset(
^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py", line 108, in __init__
self._tools: Final[List[RestApiTool]] = list(self._parse(spec_dict))
^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py", line 158, in _parse
operations = OpenApiSpecParser().parse(openapi_spec_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py", line 71, in parse
operations = self._collect_operations(openapi_spec_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py", line 120, in _collect_operations
operation_parser = OperationParser(operation)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/operation_parser.py", line 57, in __init__
self._process_operation_parameters()
File "/workspaces/EVERYTHING/joons/genai/google-chat-rag/.venv/lib/python3.12/site-packages/google/adk/tools/openapi_tool/openapi_spec_parser/operation_parser.py", line 84, in _process_operation_parameters
description if not schema.description else schema.description
^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'description'
To Reproduce
Steps to reproduce the behavior:
- Download the following OAS (extracted from our looker instance with redacted base url)
- Define a simple agent that uses
OpenAPIToolSet
in the following dir structure
demo-looker-agent
|-- __init__.py
|-- .env # put in appropriate vars GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION
|-- looker_40_openapi.json
`-- root_agent.py
agent.py
from google.adk.agents import LlmAgent
from google.adk.tools.openapi_tool import OpenAPIToolset
with open('demo-looker-agent/looker_40_openapi_fixed.json', 'r') as f:
looker_api_json = f.read()
looker_toolset = OpenAPIToolset(
spec_str=looker_api_json,
spec_str_type='json'
)
root_agent = LlmAgent(
name="looker_agent",
description="demo looker agent",
instruction='you are a looker assistant that can access looker thru api tool',
tools=[looker_toolset]
)
- Spin up adk server with
adk web
- Start a chat with the agent
- See the reported parse error
Desktop (please complete the following information):
- OS: Linux
- Python version(python -V): 3.12
- ADK version(pip show google-adk): 1.0.0
y12studioRicardBlascoEmburse
Metadata
Metadata
Assignees
Labels
models[Component] Issues related to model support[Component] Issues related to model support