-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Explicitly raise ContextWindowExceptions #228
Comments
cc: @yujonglee feel free to add any additional details |
In the OpenAI Docs, it said And it can be Like @krrishdholakia mentioned, one might want to retry with longer context window model only if It can be implemented as subclass of |
Investigating this more - not all providers return a detailed enough error message (e.g. baseten returns a 500 error). We can implement this on a case-by-case basis (i.e. for those that do return a specific max tokens / context window exceeded message) we can return this exception (this should be the 90% case tbh). |
Should be available across all models from |
Your feature request in one line
Explicitly raise ContextWindowExceptions
Describe the solution you'd like
Raise an exception to specifically call out when a context window exceeded exception occurs. OpenAI can raise invalidrequest errors for several reasons - but the fallback strategy specifically for context window exceptions is different
The text was updated successfully, but these errors were encountered: