fix(vector_stores): use PEP 604 union syntax to satisfy UP045 strict gate

This commit is contained in:
Sarveswaran MG 2026-07-22 22:34:51 +05:30
parent 00a478fb4d
commit 96be6a5262

View file

@ -25,7 +25,7 @@ else:
class VectorStoreIndexRegistry:
def __init__(self, vector_store_indexes: Optional[List[LiteLLM_ManagedVectorStoreIndex]] = None):
def __init__(self, vector_store_indexes: List[LiteLLM_ManagedVectorStoreIndex] | None = None):
self.vector_store_indexes: List[LiteLLM_ManagedVectorStoreIndex] = list(vector_store_indexes or ())
def get_vector_store_indexes(self) -> List[LiteLLM_ManagedVectorStoreIndex]:
@ -96,7 +96,7 @@ class VectorStoreIndexRegistry:
class VectorStoreRegistry:
def __init__(self, vector_stores: Optional[List[LiteLLM_ManagedVectorStore]] = None):
def __init__(self, vector_stores: List[LiteLLM_ManagedVectorStore] | None = None):
self.vector_stores: List[LiteLLM_ManagedVectorStore] = list(vector_stores or ())
self.vector_store_ids_to_vector_store_map: Dict[str, LiteLLM_ManagedVectorStore] = {}
@ -378,7 +378,7 @@ class VectorStoreRegistry:
return vector_stores_to_run
def _get_vector_store_ids_from_tool_calls(
self, tools: Optional[List[Dict]] = None, vector_store_ids: Optional[List[str]] = None
self, tools: List[Dict] | None = None, vector_store_ids: List[str] | None = None
) -> List[str]:
"""
Returns the vector store ids from the tool calls