Download scratch/test_query.py from Nagendravarma/Health-Insurance-RAG: direct link, hf CLI and curl.
- Browser
- Download file 607 Bytes
-
https://huggingface.co/spaces/Nagendravarma/Health-Insurance-RAG/resolve/main/scratch/test_query.py
- Command line
-
hf download hf://spaces/Nagendravarma/Health-Insurance-RAG/scratch/test_query.py
-
curl -L -o test_query.py https://huggingface.co/spaces/Nagendravarma/Health-Insurance-RAG/resolve/main/scratch/test_query.py
607 Bytes
| import sys | |
| import os | |
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| from retrieval.graph_retriever import GraphRetriever | |
| gr = GraphRetriever() | |
| print("Graph loaded successfully.") | |
| print("Entities:", gr._extract_entities("find heart doctors in silver plan")) | |
| try: | |
| docs = gr.invoke("find heart doctors in silver plan") | |
| print(f"Success! Retrieved {len(docs)} documents.") | |
| for d in docs: | |
| print("DOCUMENT:") | |
| print(d.page_content) | |
| print("-" * 50) | |
| except Exception as e: | |
| print("CRASHED:", e) | |
| import traceback | |
| traceback.print_exc() | |