From bd2236831bb1e23f45bb7680ae558e18b088375f Mon Sep 17 00:00:00 2001 From: Sarveswaran MG Date: Thu, 6 Aug 2026 22:37:22 +0530 Subject: [PATCH] fix(vector_stores): restore builtin generics so the registry module imports The merge with litellm_internal_staging kept List/Dict annotations from this branch while upstream had already switched the file to builtin generics and dropped those names from its typing import, so importing litellm.vector_stores.vector_store_registry raised NameError and every CI job that imports litellm failed. --- litellm/vector_stores/vector_store_registry.py | 14 +++++++------- .../vector_stores/test_vector_store_registry.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/litellm/vector_stores/vector_store_registry.py b/litellm/vector_stores/vector_store_registry.py index 71e7829ba16..61cf5923b02 100644 --- a/litellm/vector_stores/vector_store_registry.py +++ b/litellm/vector_stores/vector_store_registry.py @@ -25,8 +25,8 @@ else: class VectorStoreIndexRegistry: - def __init__(self, vector_store_indexes: List[LiteLLM_ManagedVectorStoreIndex] | None = None): - self.vector_store_indexes: List[LiteLLM_ManagedVectorStoreIndex] = list(vector_store_indexes or ()) + 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,9 +96,9 @@ class VectorStoreIndexRegistry: class VectorStoreRegistry: - 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] = {} + 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] = {} def _extract_tool_params(self, tool: dict) -> VectorStoreToolParams: """ @@ -377,8 +377,8 @@ class VectorStoreRegistry: return vector_stores_to_run def _get_vector_store_ids_from_tool_calls( - self, tools: List[Dict] | None = None, vector_store_ids: List[str] | None = None - ) -> List[str]: + self, tools: list[dict] | None = None, vector_store_ids: list[str] | None = None + ) -> list[str]: """ Returns the vector store ids from the tool calls """ diff --git a/tests/test_litellm/vector_stores/test_vector_store_registry.py b/tests/test_litellm/vector_stores/test_vector_store_registry.py index 70a38de9317..049f2dca340 100644 --- a/tests/test_litellm/vector_stores/test_vector_store_registry.py +++ b/tests/test_litellm/vector_stores/test_vector_store_registry.py @@ -281,7 +281,7 @@ def test_delete_vector_store_index_removes_by_name(): def test_get_vector_store_ids_from_tool_calls_does_not_share_or_mutate(): """ - Regression test: _get_vector_store_ids_from_tool_calls took `vector_store_ids: List[str] = []` + Regression test: _get_vector_store_ids_from_tool_calls took `vector_store_ids: list[str] = []` and extended it in place, so the def-time default accumulated ids across every call that omitted the argument, and a caller-supplied list was mutated behind the caller's back. """