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]

fix(scripts): use PEP 604 union syntax for Optional[str]

siyoonb346dd414bf7
diff --git a/.github/scripts/auto_update_price_and_context_window_file.py b/.github/scripts/auto_update_price_and_context_window_file.py
index 523ec148fc6..596f9a42760 100644
--- a/.github/scripts/auto_update_price_and_context_window_file.py
+++ b/.github/scripts/auto_update_price_and_context_window_file.py
@@ -1,7 +1,7 @@
import asyncio
import aiohttp
import json
-from typing import Any, Optional
+from typing import Any
# Asynchronously fetch data from a given URL
async def fetch_data(url):
@@ -58,7 +58,7 @@ EFFORT_FLAG_MAP = {
}
-def _find_base_model_entry(base_model: str, local_data: dict) -> Optional[str]:
+def _find_base_model_entry(base_model: str, local_data: dict) -> str | None:
if not base_model:
return None
bm_tail = base_model.split("/")[-1].lower()