You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Test cases for is_error_str_context_window_exceeded
6
8
# Tuple format: (error_message, expected_result)
7
9
context_window_test_cases= [
8
10
# Positive cases (should return True)
9
-
("An error occurred: The input exceeds the model's maximum context limit of 8192 tokens.", True),
10
-
("Some text before, this model's maximum context length is 4096 tokens. Some text after.", True),
11
-
("Validation Error: string too long. expected a string with maximum length 1000.", True),
11
+
(
12
+
"An error occurred: The input exceeds the model's maximum context limit of 8192 tokens.",
13
+
True,
14
+
),
15
+
(
16
+
"Some text before, this model's maximum context length is 4096 tokens. Some text after.",
17
+
True,
18
+
),
19
+
(
20
+
"Validation Error: string too long. expected a string with maximum length 1000.",
21
+
True,
22
+
),
12
23
("Your prompt is longer than the model's context length of 2048.", True),
13
24
("AWS Bedrock Error: The request payload size has exceed context limit.", True),
14
-
("Input tokens exceed the configured limit of 272000 tokens. Your messages resulted in 509178 tokens. Please reduce the length of the messages.", True),
15
-
25
+
(
26
+
"Input tokens exceed the configured limit of 272000 tokens. Your messages resulted in 509178 tokens. Please reduce the length of the messages.",
27
+
True,
28
+
),
16
29
# Test case insensitivity
17
30
("ERROR: THIS MODEL'S MAXIMUM CONTEXT LENGTH IS 1024.", True),
0 commit comments