From 239c2a9eef36aaeb54e2b6805d4bb28b6bfc832f Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Mon, 21 Jul 2025 11:16:40 +0100 Subject: [PATCH] feat(vector-io): add delete_chunk stub methods for unsupported providers Add NotImplementedError placeholders for delete_chunk and _delete_openai_chunk_from_vector_store methods in Chroma, Qdrant, and Weaviate providers that don't yet support the File API --- llama_stack/providers/remote/vector_io/chroma/chroma.py | 6 ++++++ llama_stack/providers/remote/vector_io/qdrant/qdrant.py | 6 ++++++ llama_stack/providers/remote/vector_io/weaviate/weaviate.py | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/llama_stack/providers/remote/vector_io/chroma/chroma.py b/llama_stack/providers/remote/vector_io/chroma/chroma.py index bd968d96d..596f288fa 100644 --- a/llama_stack/providers/remote/vector_io/chroma/chroma.py +++ b/llama_stack/providers/remote/vector_io/chroma/chroma.py @@ -112,6 +112,9 @@ class ChromaIndex(EmbeddingIndex): ) -> QueryChunksResponse: raise NotImplementedError("Keyword search is not supported in Chroma") + async def delete_chunk(self, chunk_id: str) -> None: + raise NotImplementedError("delete_chunk is not supported in Chroma") + async def query_hybrid( self, embedding: NDArray, @@ -208,3 +211,6 @@ class ChromaVectorIOAdapter(OpenAIVectorStoreMixin, VectorIO, VectorDBsProtocolP index = VectorDBWithIndex(vector_db, ChromaIndex(self.client, collection), self.inference_api) self.cache[vector_db_id] = index return index + + async def _delete_openai_chunk_from_vector_store(self, store_id: str, chunk_id: str) -> None: + raise NotImplementedError("OpenAI Vector Stores API is not supported in Chroma") diff --git a/llama_stack/providers/remote/vector_io/qdrant/qdrant.py b/llama_stack/providers/remote/vector_io/qdrant/qdrant.py index 5bdea0ce8..cbaba0543 100644 --- a/llama_stack/providers/remote/vector_io/qdrant/qdrant.py +++ b/llama_stack/providers/remote/vector_io/qdrant/qdrant.py @@ -82,6 +82,9 @@ class QdrantIndex(EmbeddingIndex): await self.client.upsert(collection_name=self.collection_name, points=points) + async def delete_chunk(self, chunk_id: str) -> None: + raise NotImplementedError("delete_chunk is not supported in qdrant") + async def query_vector(self, embedding: NDArray, k: int, score_threshold: float) -> QueryChunksResponse: results = ( await self.client.query_points( @@ -307,3 +310,6 @@ class QdrantVectorIOAdapter(VectorIO, VectorDBsProtocolPrivate): file_id: str, ) -> VectorStoreFileObject: raise NotImplementedError("OpenAI Vector Stores API is not supported in Qdrant") + + async def _delete_openai_chunk_from_vector_store(self, store_id: str, chunk_id: str) -> None: + raise NotImplementedError("OpenAI Vector Stores API is not supported in Qdrant") diff --git a/llama_stack/providers/remote/vector_io/weaviate/weaviate.py b/llama_stack/providers/remote/vector_io/weaviate/weaviate.py index 35bb40454..6929aeb54 100644 --- a/llama_stack/providers/remote/vector_io/weaviate/weaviate.py +++ b/llama_stack/providers/remote/vector_io/weaviate/weaviate.py @@ -66,6 +66,9 @@ class WeaviateIndex(EmbeddingIndex): # TODO: make this async friendly collection.data.insert_many(data_objects) + async def delete_chunk(self, chunk_id: str) -> None: + raise NotImplementedError("delete_chunk is not supported in Chroma") + async def query_vector(self, embedding: NDArray, k: int, score_threshold: float) -> QueryChunksResponse: collection = self.client.collections.get(self.collection_name) @@ -264,3 +267,6 @@ class WeaviateVectorIOAdapter( async def _delete_openai_vector_store_file_from_storage(self, store_id: str, file_id: str) -> None: raise NotImplementedError("OpenAI Vector Stores API is not supported in Weaviate") + + async def _delete_openai_chunk_from_vector_store(self, store_id: str, chunk_id: str) -> None: + raise NotImplementedError("OpenAI Vector Stores API is not supported in Weaviate")