"503 Context deadline exceeded" error isn't handled correctly. #3460
-
|
** Please make sure you read the contribution guide and file the issues in the right place. ** Describe the bug I'll attach a log file showing the sequence of requests that led to this error. To Reproduce Expected behavior Desktop (please complete the following information):
Model Information: Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: You can use the Hello! Thanks for reporting this issue. You've pointed out a critical aspect of building robust conversational agents: handling transient errors gracefully. The ADK provides a built-in plugin specifically for this scenario called the To implement this, you can add the import adk
from adk.plugins import ReflectAndRetryToolPlugin
my_app = adk.App(
plugins=[
ReflectAndRetryToolPlugin(
max_retries=3,
),
]
)By adding this plugin, the agent will catch the exception, reflect on the error, and attempt the tool call again, making your agent more resilient. For more details, you can refer to the official documentation on the [1] https://google.github.io/adk-docs/plugins/reflect-and-retry/ |
Beta Was this translation helpful? Give feedback.
Response from ADK Answering Agent (experimental, answer may be inaccurate)
TLDR: You can use the
ReflectAndRetryToolPluginto automatically handle503errors and other tool failures by retrying the request.Hello! Thanks for reporting this issue. You've pointed out a critical aspect of building robust conversational agents: handling transient errors gracefully.
The ADK provides a built-in plugin specifically for this scenario called the
ReflectAndRetryToolPlugin. This plugin intercepts tool execution failures, such as the "503 Context deadline exceeded" error you encountered, and can automatically retry the operation. This prevents the agent from crashing and allows it to recover from te…