fix(utils.py): add new error string to context window exception mapping

This commit is contained in:
Krrish Dholakia 2024-06-20 12:01:11 -07:00
parent bc01a66e44
commit 5c81688f3c

View file

@ -5688,7 +5688,11 @@ def exception_type(
+ "Exception"
)
if "This model's maximum context length is" in error_str:
if (
"This model's maximum context length is" in error_str
or "string too long. Expected a string with maximum length"
in error_str
):
exception_mapping_worked = True
raise ContextWindowExceededError(
message=f"ContextWindowExceededError: {exception_provider} - {message}",