-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Exception #21
Fix Exception #21
Conversation
thanks @yiranwu0 for the changes. can you confirm if the updated code is working as expected with all the clients. have you tested it? if not @marklysze and i can give it a try. cc @marklysze |
Yep, I'll have a look and test now. |
Thanks for raising this PR @yiranwu0, better bubbling of exceptions and centralised retries is definitely needed with all the client classes in place. From what I understand from the code changes, the client-specific exceptions are added to client.py and then handled in the I was testing with Bedrock and checked out the exceptions that could be raised, and there's quite a lot of possible exceptions (boto and aws exceptions and click Amazon Bedrock is probably going to be the one with the most exceptions, though Anthropic with Bedrock may also have a few. Additionally, some exceptions may have the same name, so if we continue with the proposed approach then perhaps we should prefix them, e.g. Let me know what you think... |
Hello @marklysze, thank you for testing it! However, I think it is good if we can have all the rate limit exceptions wrapped in an exception of our own, so that we only need to catch one exception. But that needs more thinking and could be done in the next PR. |
Thanks @yiranwu0, sounds like a plan! I'll look at the rest of the client classes and test :) |
…here stop error, removed try/except for Ollama
Hey @yiranwu0, I've updated the code as follows:
It caught exceptions when they arose. Though I can't test all exceptions. |
Hello @marklysze, your change looks good! I already tested Gemini. If there are good, we can merge it! |
Okay, great... I'm good with it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. Thanks @yiranwu0 and @marklysze
Added FAQ.md as placeholder
Why are these changes needed?
Fix exceptions of non-OpenAI generations:
Fix Gemini retry:
OpenAIWrapper
.OpenAIWrapper
only catches OpenAI rate limits. This PR adds catches of google's rate limits so that different keys can be tried.Future todo:
OpenAIWrapper
. Currently only gemini is added.OpenAIWrapper
to wait out the rate limits.Related issue number
Checks