mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
Merge 3cf2776244 into 902736bfe7
This commit is contained in:
commit
3812fa8825
2 changed files with 9 additions and 0 deletions
|
|
@ -92,11 +92,13 @@ class ExceptionCheckers:
|
|||
known_exception_substrings: Final = [
|
||||
"exceed context limit",
|
||||
"this model's maximum context length is",
|
||||
"exceeds the context window of this model", # OpenAI (current wording)
|
||||
"string too long. expected a string with maximum length",
|
||||
"model's maximum context limit",
|
||||
"is longer than the model's context length",
|
||||
"input tokens exceed the configured limit",
|
||||
"`inputs` tokens + `max_new_tokens` must be",
|
||||
"exceeded model token limit", # Moonshot
|
||||
"exceeds the available context size", # llama.cpp/Lemonade
|
||||
"exceeds the maximum number of tokens allowed", # Gemini
|
||||
]
|
||||
|
|
|
|||
|
|
@ -64,6 +64,13 @@ context_window_test_cases = [
|
|||
'GeminiException BadRequestError - {\n "error": {\n "code": 400,\n "message": "The input token count (2800010) exceeds the maximum number of tokens allowed (1048575).",\n "status": "INVALID_ARGUMENT"\n }\n}\n',
|
||||
True,
|
||||
),
|
||||
# OpenAI current context window wording
|
||||
(
|
||||
"Your input exceeds the context window of this model. Please adjust your input and try again.",
|
||||
True,
|
||||
),
|
||||
# Moonshot token limit format
|
||||
("Invalid request: Your request exceeded model token limit: 262144", True),
|
||||
# Test case insensitivity
|
||||
("ERROR: THIS MODEL'S MAXIMUM CONTEXT LENGTH IS 1024.", True),
|
||||
# Cerebras context window error format
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue