diff --git a/litellm/vector_stores/vector_store_registry.py b/litellm/vector_stores/vector_store_registry.py index b71d6784873..9a18f88a9fc 100644 --- a/litellm/vector_stores/vector_store_registry.py +++ b/litellm/vector_stores/vector_store_registry.py @@ -6,6 +6,7 @@ from typing import ( TYPE_CHECKING, Any, # noqa: TID251 # untyped non_default_params dict is the only source of the unknown key type Final, + Optional, cast, # noqa: TID251 # untyped non_default_params dict is the only source of the unknown key type get_args, ) @@ -32,8 +33,13 @@ else: class VectorStoreIndexRegistry: - def __init__(self, vector_store_indexes: list[LiteLLM_ManagedVectorStoreIndex] = []): - self.vector_store_indexes: list[LiteLLM_ManagedVectorStoreIndex] = vector_store_indexes + def __init__( + self, + vector_store_indexes: Optional[list[LiteLLM_ManagedVectorStoreIndex]] = None, + ): + self.vector_store_indexes: list[LiteLLM_ManagedVectorStoreIndex] = ( + vector_store_indexes if vector_store_indexes is not None else [] + ) def get_vector_store_indexes(self) -> list[LiteLLM_ManagedVectorStoreIndex]: """ @@ -101,8 +107,13 @@ class VectorStoreIndexRegistry: class VectorStoreRegistry: - def __init__(self, vector_stores: list[LiteLLM_ManagedVectorStore] = []): - self.vector_stores: list[LiteLLM_ManagedVectorStore] = vector_stores + def __init__( + self, + vector_stores: Optional[list[LiteLLM_ManagedVectorStore]] = None, + ): + self.vector_stores: list[LiteLLM_ManagedVectorStore] = ( + vector_stores if vector_stores is not None else [] + ) self.vector_store_ids_to_vector_store_map: dict[str, LiteLLM_ManagedVectorStore] = {} def _extract_tool_params(self, tool: dict) -> VectorStoreToolParams: