Spaces:
Sleeping
Sleeping
File size: 585 Bytes
02ce710 c696a51 02ce710 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from src.rag import answer
if __name__ == "__main__":
print("=== RAG CLI ===")
print("Gõ 'quit' để thoát\n")
while True:
question = input("Câu hỏi: ").strip()
if question.lower() in ("quit", "exit", "q"):
break
if not question:
continue
result = answer(question)
print(f"\nTrả lời: {result['answer']}")
print("\nNguồn:")
for s in result["sources"]:
print(f" - {s['source']} (trang {s['page']}, rrf: {s['rrf_score']}, rerank: {s['rerank_score']})")
print()
|