Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(test_utils.py): fix cache creation tokens

Krrish Dholakiae735808614d4
diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py
index 0c7aa527240..e98fc8bddb4 100644
--- a/tests/test_litellm/test_utils.py
+++ b/tests/test_litellm/test_utils.py
@@ -508,6 +508,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"supports_computer_use": {"type": "boolean"},
"cache_creation_input_audio_token_cost": {"type": "number"},
"cache_creation_input_token_cost": {"type": "number"},
+ "cache_creation_input_token_cost_above_1hr": {"type": "number"},
"cache_creation_input_token_cost_above_200k_tokens": {"type": "number"},
"cache_read_input_token_cost": {"type": "number"},
"cache_read_input_token_cost_above_200k_tokens": {"type": "number"},
@@ -661,24 +662,24 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"type": "array",
"items": {"type": "number"},
"minItems": 2,
- "maxItems": 2
+ "maxItems": 2,
},
"input_cost_per_token": {"type": "number"},
"output_cost_per_token": {"type": "number"},
"cache_read_input_token_cost": {"type": "number"},
- "output_cost_per_reasoning_token": {"type": "number"}
+ "output_cost_per_reasoning_token": {"type": "number"},
},
"required": ["range"],
- "additionalProperties": False
- }
+ "additionalProperties": False,
+ },
},
},
"additionalProperties": False,
},
}
- prod_json = "./model_prices_and_context_window.json"
- # prod_json = "../../model_prices_and_context_window.json"
+ # prod_json = "./model_prices_and_context_window.json"
+ prod_json = "../../model_prices_and_context_window.json"
with open(prod_json, "r") as model_prices_file:
actual_json = json.load(model_prices_file)
assert isinstance(actual_json, dict)
@@ -843,7 +844,6 @@ for commitment in BEDROCK_COMMITMENTS:
print("block_list", block_list)
-
def test_supports_computer_use_utility():
"""
Tests the litellm.utils.supports_computer_use utility function.
@@ -925,8 +925,7 @@ def test_pre_process_non_default_params(model, custom_llm_provider):
from litellm.utils import ProviderConfigManager, pre_process_non_default_params
provider_config = ProviderConfigManager.get_provider_chat_config(
- model=model,
- provider=LlmProviders(custom_llm_provider)
+ model=model, provider=LlmProviders(custom_llm_provider)
)
class ResponseFormat(BaseModel):