mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(vector_stores): track config-defined vector store ids as an immutable frozenset
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
f577c7d3a4
commit
8d39a86e45
1 changed files with 3 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ class VectorStoreRegistry:
|
|||
def __init__(self, vector_stores: list[LiteLLM_ManagedVectorStore] = []):
|
||||
self.vector_stores: list[LiteLLM_ManagedVectorStore] = vector_stores
|
||||
self.vector_store_ids_to_vector_store_map: dict[str, LiteLLM_ManagedVectorStore] = {}
|
||||
self.config_vector_store_ids: set[str] = set()
|
||||
self.config_vector_store_ids: frozenset[str] = frozenset()
|
||||
|
||||
def _extract_tool_params(self, tool: dict) -> VectorStoreToolParams:
|
||||
"""
|
||||
|
|
@ -430,7 +430,7 @@ class VectorStoreRegistry:
|
|||
updated_at=datetime.now(timezone.utc),
|
||||
)
|
||||
self.vector_stores.append(litellm_managed_vector_store)
|
||||
self.config_vector_store_ids.add(vector_store_id)
|
||||
self.config_vector_store_ids = self.config_vector_store_ids | frozenset((vector_store_id,))
|
||||
|
||||
verbose_logger.debug(
|
||||
"all loaded vector stores = %s",
|
||||
|
|
@ -476,7 +476,7 @@ class VectorStoreRegistry:
|
|||
for vector_store in self.vector_stores
|
||||
if vector_store.get("vector_store_id") != vector_store_id
|
||||
]
|
||||
self.config_vector_store_ids.discard(vector_store_id)
|
||||
self.config_vector_store_ids = self.config_vector_store_ids - frozenset((vector_store_id,))
|
||||
|
||||
def update_vector_store_in_registry(self, vector_store_id: str, updated_data: LiteLLM_ManagedVectorStore):
|
||||
"""Update or add a vector store in the registry"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue