Skip to content
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

Why not use ContextWindowExceedError instead? #372

Open
krrishdholakia opened this issue Sep 25, 2023 · 0 comments
Open

Why not use ContextWindowExceedError instead? #372

krrishdholakia opened this issue Sep 25, 2023 · 0 comments

Comments

@krrishdholakia
Copy link

Hey @Dominastorm,

LiteLLM exposes a custom exception for context window errors called ContextWindowExceededError. It's a subclass of Invalid Request Error, but this way it ensures that context window exceptions across all providers are mapped to the same error.

isinstance(exc, openai.error.InvalidRequestError)

More on this here: https://docs.litellm.ai/docs/exception_mapping#custom-mapping-list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant