mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-27 01:22:18 +00:00
test(vertex): pin Gemini Embedding 2 cost cases to the in-repo cost map
TestProcessEmbedContentResponseUsage checks per-image, per-video-second, and per-audio-second billing for gemini-embedding-2. Those rates live in this branch's model_prices_and_context_window.json, but at import time litellm.model_cost is fetched from main, which has migrated the same model to per-token pricing. In CI the fetch succeeds and prompt_cost drops to 0 (image cases) or misses the video component (audio+video), so the class-level assertions against the checked-in rates fail. Reuse the existing local_model_cost_map fixture in tests/test_litellm/conftest.py so the class always reads the in-repo map and clears the get_model_info LRU cache on entry and exit. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
parent
252c71c0b2
commit
9c71a3ac16
1 changed files with 6 additions and 0 deletions
|
|
@ -307,6 +307,12 @@ class TestProcessEmbedContentResponseUsage:
|
|||
|
||||
MODEL = "gemini-embedding-2"
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _use_local_model_cost_map(self, local_model_cost_map):
|
||||
"""Test pins per-image / per-second rates that the fetched-from-``main`` cost map has
|
||||
migrated to per-token pricing, so drive the assertion against the in-repo cost map."""
|
||||
return local_model_cost_map
|
||||
|
||||
def test_multimodal_image_preserves_usage_metadata(self):
|
||||
response_json = {
|
||||
"embedding": {"values": [0.1, 0.2, 0.3]},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue