Ishaan Jaffer
e8461b5b97
style: run black formatter on files from main merge
2026-04-17 13:02:59 -07:00
Yuneng Jiang
b39748daf2
[Fix] Update gemini-2.0-flash to gemini-2.5-flash in test_gemini integration tests
...
gemini-2.0-flash is no longer available to new users, causing 404 errors
in llm_translation_testing tests.
2026-03-30 13:53:38 -07:00
yuneng-jiang
beee329b26
Fix flaky test_gemini_image_generation_async by removing non-deterministic content assertion
...
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:58:00 -07:00
yuneng-jiang
15075ef9ec
fix(tests): update outdated model names in o1 and gemini tests
...
OpenAI retired o1-mini, o1-preview, gpt-4-0314, and gpt-4-32k from the model
cost map. Google renamed gemini-2.5-flash-image-preview to gemini-2.5-flash-image.
Updated tests to use current model names.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 22:50:52 -07:00
Sameer Kankute
374c35a6b7
Fix update deprecated model test
2026-03-12 18:34:15 +05:30
Varad Khonde
6d4a281ba0
fix(gemini): handle 'minimal' reasoning_effort param for gemini-3.1-flash-lite-preview
2026-03-06 00:26:45 +05:30
Ishaan Jaff
235a47c576
fix(tests): mock test_claude_tool_use_with_gemini to fix flaky CI ( #21832 )
...
* ui fixes
* fix(tests): mock test_claude_tool_use_with_gemini to avoid MALFORMED_FUNCTION_CALL flakiness
2026-02-21 14:34:54 -08:00
Ishaan Jaff
74ef034110
fix(tests): add flaky retries to flaky CI tests ( #21795 )
...
* fix(tests): add flaky retries and error handling to test_create_eval
* fix(tests): add flaky retries to test_cohere_v2_conversation_history
* fix(tests): add flaky retries to test_gemini_url_context
2026-02-21 11:56:29 -08:00
Ishaan Jaff
5cfcf67d7c
[Feat] /chat/completions - allow using OpenAI style tools for web_search with VertexAI/gemini models ( #20280 )
...
* test_gemini_openai_web_search_tool_to_google_search
* feat: Handle OpenAI style web search tools
2026-02-02 19:36:36 -08:00
Ishaan Jaff
d2a40c8456
[Fix] - Reliability fix OOMs with image url handling ( #19257 )
...
* fix MAX_IMAGE_URL_DOWNLOAD_SIZE_MB
* test_image_exceeds_size_limit_with_content_length
* fix: _process_image_response
* add constants 50MB
* fix convert_to_anthropic_image_obj image handling
* test_gemini_image_size_limit_exceeded
* MAX_IMAGE_URL_DOWNLOAD_SIZE_MB fix
* MAX_IMAGE_URL_DOWNLOAD_SIZE_MB
* test_image_size_limit_disabled
* async_convert_url_to_base64
* docs fix
* code QA check
* fix Exception
2026-01-16 16:41:44 -08:00
Yuta Saito
34e8e97222
fix: ci test
...
gemini 2.5 depricated
2026-01-17 09:17:31 +09:00
Sameer Kankute
e3cf0110bb
Rename: gemini-3-flash-preview
2025-12-17 21:48:15 +05:30
Sameer Kankute
22e86cde2a
Add support for gemini 3 flash via v1/messages endpoint
2025-12-17 18:03:54 +05:30
Sameer Kankute
ec30032bc3
Fix nvdia and geminin tests
2025-12-10 22:05:11 +05:30
ripepersimmon
be970735de
feat: Add gemini-3-pro-image-preview model support for imageSize parameters ( #17019 )
...
- Add model identifier to FLASH_IMAGE_PREVIEW_MODEL_IDENTIFIERS
- Add imageSize parameter support (1K, 2K, 4K) with GeminiImageSize type
- Add tests for imageSize parameter transformation
- Update documentation with new model
2025-11-25 19:38:29 -08:00
Cesar Garcia
491f57a349
feat: Add support for reasoning_effort="none" for Gemini models ( #16548 )
...
Implements support for reasoning_effort="none" parameter for Gemini models,
providing significant cost savings (up to 96% cheaper) by disabling thinking
budget while maintaining response quality.
Changes:
- Added "supports_reasoning": true to gemini-2.0-flash-thinking-exp-01-21 in model config
- Implemented mapping for reasoning_effort="none" to thinkingConfig {thinkingBudget: 0, includeThoughts: false}
- Added unit test to verify the mapping works correctly
Performance impact:
- Without reasoning_effort: ~313 tokens
- With reasoning_effort="none": ~12 tokens (96% cheaper)
Closes #16420
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2025-11-12 19:41:07 -08:00
Cesar Garcia
049d45ea90
fix(gemini): Preserve non-ASCII characters in function call arguments ( #16550 )
...
Fixes #16533
Before this fix, non-ASCII characters (Japanese, Spanish, Chinese, etc.)
in function call arguments were being escaped as Unicode sequences.
Example:
- Before: "やあ" → "\u3084\u3042"
- After: "やあ" → "やあ" (preserved)
Changes:
- Add ensure_ascii=False to json.dumps() in _transform_parts()
- Add test for Japanese and Spanish Unicode character preservation
This is not a breaking change as both formats are equivalent in JSON.
The fix improves readability and aligns with OpenAI's behavior.
2025-11-12 19:01:38 -08:00
Sameer Kankute
394da34a0b
Add all gemini image models support in image generation ( #16526 )
2025-11-12 18:26:44 -08:00
Ishaan Jaffer
9b4e32c880
Revert "Added support for desabling thoughts by setting budget to 0 ( #16347 )"
...
This reverts commit b6f792f301 .
2025-11-08 11:34:05 -08:00
Ishaan Jaffer
da7ecb3ea9
test_gemini_reasoning_effort_zero_budget_disables_thoughts
2025-11-08 11:10:54 -08:00
Ishaan Jaffer
7bf9d69007
test_gemini_reasoning_effort_env_override
2025-11-07 22:09:59 -08:00
Sameer Kankute
b6f792f301
Added support for desabling thoughts by setting budget to 0 ( #16347 )
2025-11-07 19:19:16 -08:00
Krish Dholakia
07ba5c1ea9
Merge branch 'main' into litellm_dev_10_10_2025_p3
2025-10-11 12:58:53 -07:00
Ishaan Jaffer
33a4676184
test fix
2025-10-11 10:05:22 -07:00
Ishaan Jaffer
c467986b8b
test_gemini_context_caching_with_ttl
2025-10-11 09:20:20 -07:00
Krrish Dholakia
fed1ba2891
feat(openai/): convert chat completion tool calls to responses api
...
enables gpt-5-codex to work on claude code
Closes LIT-1088
2025-10-10 19:41:11 -07:00
Krish Dholakia
12a1d081ee
Merge branch 'main' into litellm_dev_09_11_2025_p1
2025-10-08 19:02:58 -07:00
Ishaan Jaffer
be7ab0b3e3
test_gemini_url_context
2025-10-04 12:23:43 -07:00
Ishaan Jaffer
97f0f3fe32
test_gemini_finish_reason
2025-09-27 10:57:22 -07:00
Ishaan Jaffer
7236202e41
test fix
2025-09-20 09:28:15 -07:00
Krish Dholakia
0f0f4327a3
Merge pull request #14589 from timelfrink/fix/issue-14586-gemini-exception-messages
...
Fix: Updated error message for Gemini API
2025-09-19 23:29:21 -07:00
Tim Elfrink
5323ca8346
Fix Gemini 2.5 Flash Image Preview response parsing
...
- Add response_modalities configuration to request format
- Fix response parsing to use camelCase 'inlineData' instead of snake_case 'inline_data'
- Update test to validate proper request format and response parsing
- All existing Gemini image generation tests pass
2025-09-19 11:20:03 +02:00
Tim Elfrink
3a98fd6096
Remove hardcoded model name and fix breaking change
...
- Reverted GEMINI_2_5_FLASH_IMAGE_PREVIEW_MODEL constant usage
- Made endpoint selection conditional for gemini-2.5-flash-image-preview only
- Preserved existing Imagen models functionality with :predict endpoint
- Fixed potential breaking change that would affect 6 other Gemini image models
2025-09-19 09:29:14 +02:00
Tim Elfrink
f5e6246143
Add test for gemini-2.5-flash-image-preview fix
...
- Test validates correct endpoint routing to :generateContent
- Mock HTTP responses to avoid API limits
- Verify request format uses Gemini contents structure
- Ensure image generation functionality works correctly
2025-09-19 08:06:01 +02:00
Tim Elfrink
4d80a4a0fb
Fix Gemini exception messages to show GeminiException
...
- Update exception mapping to show 'GeminiException' instead of 'VertexAIException'
- Add comprehensive HTTP status code mapping for Gemini provider (401, 403, 404, 408, 429, 500+)
- Maintain OpenAI-compatible error handling patterns
- Use LlmProviders enum constants for consistent provider identification
- Add comprehensive test coverage for Gemini exception mapping
2025-09-15 21:48:14 +02:00
Ishaan Jaff
ec32a0a7d7
fix: get_base_completion_call_args
2025-09-13 09:59:08 -07:00
Krrish Dholakia
3f3efea301
test(test_gemini.py): add additional testing for additionalproperties case
2025-09-11 15:12:21 -07:00
Ishaan Jaff
e37c1069a1
fix test images gemini
2025-09-08 17:22:59 -07:00
Krish Dholakia
a3ffc3060e
Merge branch 'main' into litellm_dev_09_01_2025_p1
2025-09-06 18:50:49 -07:00
tobias-mayr
29bbde5257
fix condition ordering and test
2025-09-04 22:18:50 +01:00
Krrish Dholakia
6a2da54fa8
test: update tests
2025-09-01 18:51:05 -07:00
Krrish Dholakia
4b8f2dc051
test: update tests
2025-09-01 18:20:46 -07:00
Krrish Dholakia
0fbcc01173
feat(types/utils.py): support 'images' field in output
...
Compatible with Openrouter response format
Closes https://github.com/BerriAI/litellm/pull/14151
2025-09-01 18:05:16 -07:00
Krrish Dholakia
b6f6dc5c1c
feat(vertex_ai.py): support parsing thinking content into gemini format
...
allows function calls with thought signatures to be sent back to gemini
Closes https://github.com/BerriAI/litellm/pull/13842
2025-08-30 18:49:34 -07:00
Krrish Dholakia
51c73dc60b
fix(vertex_and_google_ai_studio_gemini.py): bubble up thoughtsignature back to client
2025-08-30 17:26:18 -07:00
Ishaan Jaff
c9b86775a7
test_system_message_with_no_user_message
2025-08-30 13:09:25 -07:00
Ishaan Jaff
dc6161535a
fix for supports_reasoning check added in 68f4847659
2025-08-30 11:06:02 -07:00
Ishaan Jaff
3fc2198d27
fix: test_gemini_image_generation_async_stream
2025-08-30 10:33:23 -07:00
Ishaan Jaff
efebf7ec7b
test_gemini_image_generation_async
2025-08-30 10:29:24 -07:00
Ishaan Jaff
04dc1a5351
[Feat] Add support for returning images with gemini/gemini-2.5-flash-image-preview with /chat/completions ( #13983 )
...
* add gemini-2.5-flash-image-preview
* add gemini-2.5-flash-image-preview
* add image in ChatCompletionResponseMessage
* test_gemini_image_generation_async
* Revert "Merge pull request #13394 from Deviad/feature/enhance_logging_for_containers"
This reverts commit 539b94ad4e , reversing
changes made to 71af7bcf9c .
* include `image` in Delta
* fix _process_candidates should show the image response
* fix: _handle_special_delta_attributes
* test_gemini_image_generation_async_stream
* image_generation_chat
* UI - allow looking at generated images from /chat/completions
* _create_streaming_choice
* fix import StreamingChoices
* fix ChatCompletionResponseMessage
* test_gemini_image_generation
* add gemini img migration
* fix _extract_candidate_metadata
* ui fix
* fix batch endpoint test
2025-08-27 16:16:19 -07:00