| 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() | |