mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-04 10:10:36 +00:00
fix(mongodb): raise exception on index initialization failure and add models_api dependency
This commit is contained in:
parent
8acc4ef7f8
commit
ab824b53e3
1 changed files with 5 additions and 5 deletions
|
|
@ -93,11 +93,11 @@ class MongoDBIndex(EmbeddingIndex):
|
||||||
f"Failed to initialize MongoDB index for vector_db: {self.vector_db.identifier}. "
|
f"Failed to initialize MongoDB index for vector_db: {self.vector_db.identifier}. "
|
||||||
f"Collection name: {self.collection.name}. Error: {str(e)}"
|
f"Collection name: {self.collection.name}. Error: {str(e)}"
|
||||||
)
|
)
|
||||||
# Don't fail completely - just log the error and continue
|
raise RuntimeError(
|
||||||
logger.warning(
|
f"Failed to initialize MongoDB vector search index. "
|
||||||
"Continuing without complete index initialization. "
|
f"Vector store '{self.vector_db.identifier}' cannot function without indexes. "
|
||||||
"You may need to create indexes manually in MongoDB Atlas dashboard."
|
f"Error: {str(e)}"
|
||||||
)
|
) from e
|
||||||
|
|
||||||
async def _create_vector_search_index(self) -> None:
|
async def _create_vector_search_index(self) -> None:
|
||||||
"""Create optimized vector search index based on MongoDB RAG best practices."""
|
"""Create optimized vector search index based on MongoDB RAG best practices."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue