litellm/tests/test_litellm/llms/gemini
mateo-berri 815fa0ff08 fix(anthropic_adapter): carry web search usage into /v1/messages cost breakdown
For non-Anthropic models served over /v1/messages, the outer wrapper recomputes
cost over the adapter-translated Anthropic response dict. That dict dropped every
web search usage signal, so the recompute overwrote the correct cost breakdown
with a token-only one: x-litellm-response-cost-tool-usage read 0.0 and
x-litellm-response-cost-original excluded the search cost, while the total kept it.

The adapter now maps web search request counts (from Usage.server_tool_use or
Gemini's prompt_tokens_details) into usage.server_tool_use.web_search_requests,
matching the Anthropic API shape, and the Gemini web search cost calculator falls
back to server_tool_use when prompt_tokens_details carries no count. The shared
get_web_search_requests helper is now public since five modules consume it.

Resolves LIT-6288
2026-08-26 18:14:10 -07:00
..
files test: document gemini file URI handling 2026-04-29 22:38:56 -07:00
image_edit test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
realtime fix(gemini-realtime): drop the native-audio speechConfig strip on Google AI Studio too 2026-08-26 15:06:23 -07:00
videos Litellm oss staging 040626 (#29671) 2026-06-04 11:07:20 -07:00
__init__.py fix(tests): stabilize 3 failing CI tests 2026-03-13 00:26:31 +00:00
test_cost_calculator.py fix(anthropic_adapter): carry web search usage into /v1/messages cost breakdown 2026-08-26 18:14:10 -07:00
test_gemini_client_setup.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_gemini_common_utils.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_gemini_image_generation_transformation.py feat(gemini): forward web search tools in image generation (#30119) 2026-06-12 07:24:36 -07:00
test_gemini_tts.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00