Files
litellm/tests
Lucas Rothman b981fddfaa fix(gemini): properly catch context window exceeded errors
Fixes #18282

This PR fixes two issues with Gemini context window error handling:

1. **Pattern matching for Gemini 2.0 Flash**: The previous pattern
   'input token count exceeds the maximum number of tokens allowed'
   doesn't match Gemini 2.0 Flash errors which include dynamic token
   counts like '(2800010)' in the message. Split into shorter patterns
   that work with both formats.

2. **Add context window check to Gemini block**: The
   is_error_str_context_window_exceeded() check was only called for
   OpenAI-compatible providers, not for Gemini/Vertex AI. Added the
   check to the Gemini-specific error handling block.

Test cases added for both Gemini 2.0 Flash and 2.5/3 error formats.
2025-12-19 23:20:04 -08:00
..
2025-12-13 16:10:48 -08:00
2025-12-19 19:00:44 +05:30
2025-12-19 23:45:37 +05:30
2025-10-04 10:57:02 -07:00
2025-10-31 20:32:03 -07:00
2025-09-27 10:59:25 -07:00
2025-11-15 10:34:24 -08:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.