Skip to content

Support Async call for RestAPITool #787

Open
@sandangel

Description

@sandangel

** Please make sure you read the contribution guide and file the issues in the rigth place. **
Contribution guide.

Describe the bug
A clear and concise description of what the bug is.
Currently RestAPITool is using requests to call API, however since this is not async, we are not able to use it in our API server to serve multiple users concurrently.

To Reproduce
Steps to reproduce the behavior:

  1. Install 'adk-python'
  2. Run 'adk api_server openapi_tool_agent'
  3. Send concurrent API requests
  4. Request is executed in sync mode.

Expected behavior
A clear and concise description of what you expected to happen.

Should use httpx or asyncio.to_thread to turn the blocking code to async

Screenshots
If applicable, add screenshots to help explain your problem.

https://github.com/google/adk-python/blob/main/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py#L455-L503

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Python version(python -V):
  • ADK version(pip show google-adk):

Additional context
Add any other context about the problem here.

Metadata

Metadata

Labels

toolsIssues related to tools

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions