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(main): use PEP 604 unions for new store and prompt_cache_key params

Sujith4eaa70440a24
diff --git a/litellm/main.py b/litellm/main.py
index 81b02082abd..3b13e04bbe3 100644
--- a/litellm/main.py
+++ b/litellm/main.py
@@ -435,8 +435,8 @@ async def acompletion(
verbosity: Optional[Literal["low", "medium", "high"]] = None,
safety_identifier: Optional[str] = None,
service_tier: Optional[str] = None,
- store: Optional[bool] = None,
- prompt_cache_key: Optional[str] = None,
+ store: bool | None = None,
+ prompt_cache_key: str | None = None,
# set api_base, api_version, api_key
base_url: Optional[str] = None,
api_version: Optional[str] = None,
@@ -4832,8 +4832,8 @@ def completion( # type: ignore
extra_headers: Optional[dict] = None,
safety_identifier: Optional[str] = None,
service_tier: Optional[str] = None,
- store: Optional[bool] = None,
- prompt_cache_key: Optional[str] = None,
+ store: bool | None = None,
+ prompt_cache_key: str | None = None,
# soon to be deprecated params by OpenAI
functions: Optional[List] = None,
function_call: Optional[str] = None,
diff --git a/litellm/utils.py b/litellm/utils.py
index b16ecdf88be..bc5b2447761 100644
--- a/litellm/utils.py
+++ b/litellm/utils.py
@@ -3791,8 +3791,8 @@ def get_optional_params(
thinking: Optional[AnthropicThinkingParam] = None,
web_search_options: Optional[OpenAIWebSearchOptions] = None,
safety_identifier: Optional[str] = None,
- store: Optional[bool] = None,
- prompt_cache_key: Optional[str] = None,
+ store: bool | None = None,
+ prompt_cache_key: str | None = None,
base_model: Optional[str] = None,
**kwargs,
):