Final_Assignment_Template / test_react.py
Paperbag's picture
Refactor GAIA results handling and improve error reporting
40dab7b
raw
history blame
607 Bytes
from agent import build_graph
from langchain_core.messages import HumanMessage
def test_agent():
graph = build_graph()
# Simple test: math question that should trigger python_repl
question = "Calculate the square root of 123456789 and multiply it by 42. Provide the final answer."
print(f"Testing with question: {question}")
messages = [HumanMessage(content=question)]
result = graph.invoke({"messages": messages})
print("\n--- Final Answer ---")
print(result['messages'][-1].content)
print("--------------------")
if __name__ == "__main__":
test_agent()