def query(self, query_text, discussion_id=None): # Load documents from MongoDB and embeddings from FAISS index documents = list(chunks_collection.find({})) if not documents: logging.error("No documents found in the database.") return {"response": "No documents found in the database.", "sources": []}
logging.info(f"Loaded {len(documents)} documents from the database")