Skip to content

Commit 415aa5a

Browse files
committed
fix: add explicit timeout to OpenAPI tool httpx client
The migration from `requests` to `httpx.AsyncClient` in PR #2872 did not specify a timeout parameter. Since `requests` defaults to no timeout while `httpx` defaults to 5 seconds, this causes `ReadTimeout` errors for API calls that take longer than 5 seconds. Set timeout to `None` to restore the previous behavior. Closes #4431
1 parent ec660ed commit 415aa5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ def __repr__(self):
560560

561561
async def _request(**request_params) -> httpx.Response:
562562
async with httpx.AsyncClient(
563-
verify=request_params.pop("verify", True)
563+
verify=request_params.pop("verify", True),
564+
timeout=None,
564565
) as client:
565566
return await client.request(**request_params)

0 commit comments

Comments
 (0)