You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building an agent with ADK and have a custom tool that makes HTTP requests to an external API. Sometimes the API is slow and the tool times out.
Is there a way to configure the timeout for individual tools in ADK? I looked at the Tool class but could not find a timeout parameter.
Example of what I am trying to do:
fromgoogle.adkimportAgent, Tooldefmy_slow_tool(query: str) ->str:
# This sometimes takes >30sresponse=requests.get(f"https://api.example.com/search?q={query}", timeout=60)
returnresponse.textagent=Agent(
model="gemini-2.0-flash",
tools=[my_slow_tool],
# How to set tool-level timeout?
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am building an agent with ADK and have a custom tool that makes HTTP requests to an external API. Sometimes the API is slow and the tool times out.
Is there a way to configure the timeout for individual tools in ADK? I looked at the Tool class but could not find a timeout parameter.
Example of what I am trying to do:
Any guidance would be appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions