Spaces:
Sleeping
Sleeping
| import asyncio | |
| import os | |
| from app.services.bible import bible_service | |
| async def main(): | |
| print("=== ORA RAG Verification (LanceDB) ===") | |
| # Check DB Path | |
| db_path = "data/lancedb_storage" | |
| if os.path.exists(db_path): | |
| print(f"[OK] LanceDB storage found at: {db_path}") | |
| else: | |
| print(f"[WARN] LanceDB storage NOT found at: {db_path} (Expected if ingestion is running/incomplete)") | |
| print("1. Initializing Service (Connecting locally)...") | |
| await bible_service.initialize_index() | |
| # Search for a common term | |
| query = "Seth" | |
| print(f"\n2. Searching for '{query}'...") | |
| results = await bible_service.search(query) | |
| print(f" -> Found {len(results)} results.") | |
| for idx, res in enumerate(results): | |
| print(f" {idx+1}. {res['reference']} (Score: {res['score']:.4f})") | |
| print(f" \"{res['text'][:100]}...\"") | |
| if results: | |
| print("\n[SUCCESS] RAG System is operational with LanceDB.") | |
| else: | |
| print("\n[FAIL] No results returned. Check embedding service or DB population.") | |
| if __name__ == "__main__": | |
| asyncio.run(main()) | |