Closed as duplicate of#782
Description
Currently there appears to be no easy way to customise the Model request retry behaviour, in cases of request error or unexpected response.
In one of my projects I've had to put exception handling around agent.run()
to catch request failures (e.g. due to "Model is overloaded"
errors from Gemini), however this is inefficient because it re-tries the entire Agent workflow (which may involve multiple model requests).
It would be good to be able to customise the retry logic for each individual model request (Model.request() call
), for both:
- Request errors (due to network issue, rate limiting, authorisation..)
- Invalid/unexpected model response content/format (to be able to prompt model to correct itself part way through a multi-step interaction)