Add context window exception mapping for Together AI (#17284)

This commit is contained in:
Boxuan Li 2025-12-01 20:02:59 -08:00 committed by GitHub
parent da5b81c1ff
commit 89458573a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -77,6 +77,7 @@ class ExceptionCheckers:
"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",
]
for substring in known_exception_substrings:
if substring in _error_str_lowercase:

View file

@ -36,6 +36,10 @@ context_window_test_cases = [
"Input tokens exceed the configured limit of 272000 tokens. Your messages resulted in 509178 tokens. Please reduce the length of the messages.",
True,
),
(
"`inputs` tokens + `max_new_tokens` must be <= 4096",
True,
),
# Test case insensitivity
("ERROR: THIS MODEL'S MAXIMUM CONTEXT LENGTH IS 1024.", True),
# Negative cases (should return False)