Spaces:
Sleeping
Sleeping
| from query import ask_question | |
| def run(): | |
| print("Ready. Ask your questions (type 'exit' to quit)\n") | |
| while True: | |
| question = input(">> ").strip() | |
| if question.lower() == "exit": | |
| break | |
| if not question: | |
| continue | |
| answer, docs = ask_question(question) | |
| print("\nAnswer:\n", answer) | |
| # Optional: show sources (very useful for debugging) | |
| print("\nSources:") | |
| for doc in docs: | |
| print("-", doc.metadata.get("book", "Unknown")) | |
| if __name__ == "__main__": | |
| run() |