-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
core[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation
Description
π‘ New Feature: Enhanced Error Handling for Gemini resourceExhausted in ADK
Description .
I'm frustrated when I encounter a resourceExhausted error while using the Gemini API through the Google ADK, and the application provides no clear, programmatic way to handle this situation gracefully or inform the user effectively. This typically happens when the user's quota limit for the Gemini API has been reached. Currently, this can lead to a poor user experience, as the api fail immediately.
Solution
To implement a retry-based solution for the resourceExhausted error without immediately cutting the stream, you should first specifically detect the quota-related error from the ADK's response, then initiate a series of escalating retries using exponential backoff to temporarily pause the interaction instead of terminating it immediately, informing the user that the service is busy and trying again shortly; if these retries fail, the system should gracefully degrade by either switching to a less resource-intensive Gemini model or disabling resource-heavy features within the current user session, only terminating the stream as a last resort when all other recovery attempts are exhausted.
VariableVic, Jihed-Benmohamed, adirani-alg, ramijemai and MarzoukiAziz
Metadata
Metadata
Assignees
Labels
core[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation