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.
This commit is contained in:
Sarveswaran MG 2026-08-06 22:37:22 +05:30
parent 11197ee135
commit bd2236831b
2 changed files with 8 additions and 8 deletions

View file

@ -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
"""

View file

@ -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.
"""