File size: 607 Bytes
40dab7b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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()
|