Files
brojs-task-6a1864f78a94f887…/main.py
T

21 lines
557 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
Simple chat loop for the RAG agent.
"""
import os
from langchain.agents import AgentExecutor
from agent import agent
# Create executor with memory
executor = AgentExecutor(agent=agent, verbose=True)
print("RAGAgent ready. Type 'exit' to quit.")
while True:
user_input = input("You: ")
if user_input.lower() in {"exit", "quit"}:
break
result = executor.invoke({"input": user_input})
# The agent returns a dict with keys 'output' and possibly tool calls.
print(f"Assistant: {result.get('output', '')}")
print("Goodbye!")