From 40d1bbdd229714f314934a5af262ad47c826b201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Fri, 5 Jun 2026 12:42:20 +0000 Subject: [PATCH] Update cli.py --- cli.py | 50 +------------------------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/cli.py b/cli.py index 9bfc72a..d4befb7 100644 --- a/cli.py +++ b/cli.py @@ -1,49 +1 @@ -"""Simple interactive CLI for the RAG agent. - -Commands: - /add title content – add a document to the knowledge base. - /search query – perform a semantic search. - /quit – exit. - any other text – will be sent to the agent for normal answering. -""" - -import sys - -from .agent import create_agent_executor - -agent = create_agent_executor() - -print("RAG Agent CLI. Type /quit to exit.") -while True: - try: - user_input = input(">>> ") - except EOFError: - break - if not user_input: - continue - if user_input.lower() == "/quit": - print("Goodbye!") - break - if user_input.startswith("/add "): - # Expected format: /add title content - parts = user_input.split(" ", 2) - if len(parts) < 3: - print("Usage: /add title content") - continue - title, content = parts[1], parts[2] - # Directly call the tool via the agent - result = agent.run({"input": f"Add document: {title} – {content}"}) - print(result) - continue - if user_input.startswith("/search "): - query = user_input[8:].strip() - result = agent.run({"input": f"Search for: {query}"}) - print(result) - continue - # Normal conversation - result = agent.run({"input": user_input}) - print(result) - -if __name__ == "__main__": - # The CLI is already running in the main thread - pass \ No newline at end of file +# Legacy file removed \ No newline at end of file