AbanteAI / spice

accelerant
Apache License 2.0
4 stars 2 forks source link

catch_and_convert_errors should support retry #89

Open jakethekoenig opened 4 months ago

jakethekoenig commented 4 months ago

On APIError or APIConnectionError we may want to retry. I'm not sure context managers can support this but it'd be nice if the client could have a retry strategy and if it gets one of those exceptions it sleeps with exponential back off with configurable base and start value and then starts at the top of the contextmanager block. And then raises the exception after a configurable number of failures.

jakethekoenig commented 4 months ago

@mentatbot can you do this?

mentatai[bot] commented 4 months ago

I will start working on this issue