Hello,
When we use js-genai directly, outside ADK, we can apply httpOptions to modify the default retry attempts. Since this is often not enough and one cannot modify the default retry codes, in our apps on production we wrap e.g., chatSession.chat.sendMessage with our own exponentialBackoff functionality. It covers other cases, like and error which just prints fetch failed too.
Now, we would like to apply the same, but how can we do this in the ADK? From what we see, ADK abstracts away the direct SDK calls, so we cannot easily wrap individual SDK invocations, can we?
One option was to extend Gemini's *generateContentAsync method, but that seems like too much, doesn't it?
Note:
For the record, it seems Python guys allowed to modify the http retry options, but I'm not sure about implementing a custom exponential backoff logic.
Thanks,
Iliyan
Hello,
When we use js-genai directly, outside ADK, we can apply httpOptions to modify the default retry attempts. Since this is often not enough and one cannot modify the default retry codes, in our apps on production we wrap e.g.,
chatSession.chat.sendMessagewith our own exponentialBackoff functionality. It covers other cases, like and error which just printsfetch failedtoo.Now, we would like to apply the same, but how can we do this in the ADK? From what we see, ADK abstracts away the direct SDK calls, so we cannot easily wrap individual SDK invocations, can we?
One option was to extend Gemini's *generateContentAsync method, but that seems like too much, doesn't it?
Note:
For the record, it seems Python guys allowed to modify the http retry options, but I'm not sure about implementing a custom exponential backoff logic.
Thanks,
Iliyan