Use 'stamina' for retries#255
Conversation
So we can drop the stamina call.
|
@KRRT7 Have a look. This uses stamina in the two essential places. UPDATE: You can now configure it via ConversationSettings. |
KRRT7
left a comment
There was a problem hiding this comment.
The retriers are bound to openai.APIError, which is the base class for all OpenAI errors — including AuthenticationError, BadRequestError, NotFoundError, PermissionDeniedError. Those will never succeed on retry.
Should target transient errors only, something like (openai.RateLimitError, openai.APIConnectionError, openai.APITimeoutError, openai.InternalServerError).
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
|
@bmerkle This needs your Approval so we can merge it. |
|
@bmerkle Thanks! |
|
strange, there were still format and import errors on main, so i now created #262 |
|
Strange indeed. I am guessing we're (once again) running different versions of isort and/or black? I have these: black, 26.3.1 (compiled: yes) |
|
I can repeat everything you see on Windows. But after merging your most recent PR #262 all is clean. There may be an explanation but I'd rather not spend more time investigating. |

Disable the older max_retries options for pydantic_ai; instead, wrap complete() and get_embedding[s]_nocache() in
@stamina(...)decorators.