removed skip_if_provider_doesnt_support_openai_vector_store_files_api, updated chroma _get_and_cache_vector_db_index, and updated test_query_unregistered_raises

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
Francisco Javier Arceo 2025-07-24 21:29:15 -04:00
parent 2defebc835
commit c7ffe98588
3 changed files with 16 additions and 36 deletions

View file

@ -58,7 +58,6 @@ class ChromaIndex(EmbeddingIndex):
self.kvstore = kvstore
async def initialize(self):
# Chroma does not require explicit initialization, this is just a helper for unit tests
pass
async def add_chunks(self, chunks: list[Chunk], embeddings: NDArray):
@ -215,18 +214,12 @@ class ChromaVectorIOAdapter(OpenAIVectorStoreMixin, VectorIO, VectorDBsProtocolP
if vector_db_id in self.cache:
return self.cache[vector_db_id]
try:
collection = await maybe_await(self.client.get_collection(vector_db_id))
if not collection:
raise ValueError(f"Vector DB {vector_db_id} not found in Chroma")
vector_db = await self.vector_db_store.get_vector_db(vector_db_id)
if not vector_db:
raise ValueError(f"Vector DB {vector_db_id} not found in Llama Stack")
index = VectorDBWithIndex(vector_db, ChromaIndex(self.client, collection), self.inference_api)
self.cache[vector_db_id] = index
return index
except Exception as exc:
raise ValueError(f"Vector DB {vector_db_id} not found in Chroma") from exc
vector_db = await self.vector_db_store.get_vector_db(vector_db_id)
if not vector_db:
raise ValueError(f"Vector DB {vector_db_id} not found in Llama Stack")
collection = await maybe_await(self.client.get_collection(vector_db_id))
if not collection:
raise ValueError(f"Vector DB {vector_db_id} not found in Chroma")
index = VectorDBWithIndex(vector_db, ChromaIndex(self.client, collection), self.inference_api)
self.cache[vector_db_id] = index
return index