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]

style(e2e): annotate the cold-call locals as Final

Yuneng Jiang1c0172b477cf
diff --git a/tests/e2e/llm_translation/test_cache_control.py b/tests/e2e/llm_translation/test_cache_control.py
index 4e11ad6cec5..7530485ad79 100644
--- a/tests/e2e/llm_translation/test_cache_control.py
+++ b/tests/e2e/llm_translation/test_cache_control.py
@@ -150,7 +150,7 @@ def _assert_cache_read_on_second_call(
def _cold_cache_calls(send: Callable[[str], Result[ChatResponse]]) -> Iterator[ChatResponse]:
for _ in range(VERTEX_COLD_CALL_ATTEMPTS):
- result = send(_cacheable_prefix())
+ result: Final = send(_cacheable_prefix())
match result:
case UnknownApiError(status_code=400, body=body) if VERTEX_CACHE_REJECTION_MARKER in body:
continue
@@ -241,7 +241,7 @@ class TestCacheControl:
)
resources.defer(lambda: client.proxy.delete_model(model_id))
key = resources.key()
- completion = _first_cold_call_reads_cache(
+ completion: Final = _first_cold_call_reads_cache(
model, lambda prefix: _cache_chat(client, key, model, prefix, ttl=VERTEX_CACHE_TTL)
)
_assert_billed_below_uncached_prompt(client, model, completion)