From 554c78ba6620b922a5eb2b4eae81ae7c7cdb471e Mon Sep 17 00:00:00 2001 From: kimbwook Date: Wed, 6 Aug 2025 14:51:10 +0900 Subject: [PATCH] add delete_chunk feature at chroma --- llama_stack/providers/remote/vector_io/chroma/chroma.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llama_stack/providers/remote/vector_io/chroma/chroma.py b/llama_stack/providers/remote/vector_io/chroma/chroma.py index 26aeaedfb..442e64f5d 100644 --- a/llama_stack/providers/remote/vector_io/chroma/chroma.py +++ b/llama_stack/providers/remote/vector_io/chroma/chroma.py @@ -10,6 +10,7 @@ from typing import Any from urllib.parse import urlparse import chromadb +from chromadb.api.models.AsyncCollection import AsyncCollection from numpy.typing import NDArray from llama_stack.apis.files import Files @@ -116,7 +117,10 @@ class ChromaIndex(EmbeddingIndex): 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") + if isinstance(self.collection, AsyncCollection): + await self.collection.delete([chunk_id]) + else: + self.collection.delete([chunk_id]) async def query_hybrid( self,