Spaces:
Running
Running
omthakur1394
feat: add core application modules including FastAPI server, CLI, search retriever, and embeddings
66bb65d Download src/cli.py from Omthakur1394/rag-api: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/spaces/Omthakur1394/rag-api/resolve/main/src/cli.py
- Command line
-
hf download hf://spaces/Omthakur1394/rag-api/src/cli.py
-
curl -L -o cli.py https://huggingface.co/spaces/Omthakur1394/rag-api/resolve/main/src/cli.py
738 Bytes
| from dotenv import load_dotenv | |
| from src.graph.state import ShopEaseRAGState | |
| from src.graph.builder import app_graph | |
| from langfuse.langchain import CallbackHandler | |
| load_dotenv() | |
| langfuse_handler = CallbackHandler() | |
| if __name__ == "__main__": | |
| while True: | |
| user_input = input("Enter your query: ") | |
| inint_state = ShopEaseRAGState(question=user_input) | |
| config = { | |
| "configurable": {"thread_id": "session_1"}, | |
| "callbacks": [langfuse_handler] | |
| } | |
| result = app_graph.invoke(inint_state, config=config) | |
| print("\n=== Final Answer ===\n", result["answer"]) | |
| print("\n=== Reflection Log ===\n", result["reflection"]) | |
| print("Total Attempts:", result["attempts"]) | |