This commit is contained in:
2026-05-12 20:01:18 +00:00
parent b08f1d0e26
commit a32371a231
+19
View File
@@ -0,0 +1,19 @@
import sys
from agent import executor
if __name__ == "__main__":
print("RAG Agent CLI. Commands: /add <title> <file>, /search <query>, /quit")
while True:
line = input("> ")
if line.startswith("/quit"):
break
if line.startswith("/add"):
_, title, file = line.split(maxsplit=2)
with open(file, "r", encoding="utf-8") as f:
text = f.read()
print(executor.invoke({"input": f"add {title} {text}"}))
elif line.startswith("/search"):
_, query = line.split(maxsplit=1)
print(executor.invoke({"input": f"search {query}"}))
else:
print("Unknown command")