From 742f62c7c0415e821e063e6548469aa4c9ba495f Mon Sep 17 00:00:00 2001 From: Brandon Hancock Date: Tue, 4 Mar 2025 16:01:00 -0500 Subject: [PATCH] Update test for multiplication --- tests/agent_test.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/agent_test.py b/tests/agent_test.py index 2afb04aad..a8c6131e2 100644 --- a/tests/agent_test.py +++ b/tests/agent_test.py @@ -1814,15 +1814,11 @@ def test_agent_streaming_with_tool_calling(): # Define a tool that will be called @tool - def calculator(expression: str) -> str: - """Calculate the result of a mathematical expression.""" + def calculator(first_number: int, second_number: int) -> float: + """Calculate the product of two numbers.""" nonlocal tool_called tool_called = True - try: - result = eval(expression) - return f"The result of {expression} is {result}" - except Exception as e: - return f"Error calculating {expression}: {str(e)}" + return first_number * second_number # Create an agent with streaming enabled agent = Agent(