diff --git a/tool_use/calculator_tool.ipynb b/tool_use/calculator_tool.ipynb index 5fdf221..8d73ea7 100644 --- a/tool_use/calculator_tool.ipynb +++ b/tool_use/calculator_tool.ipynb @@ -58,7 +58,7 @@ "\n", "def calculate(expression):\n", " # Remove any non-digit or non-operator characters from the expression\n", - " expression = re.sub(r'[^0-9+\\-*/.]', '', expression)\n", + " expression = re.sub(r'[^0-9+\-*/().]', '', expression)\n", " \n", " try:\n", " # Evaluate the expression using the built-in eval() function\n", @@ -214,10 +214,10 @@ "\n", "Tool Used: calculator\n", "Tool Input: {'expression': '(12851 - 593) * 301 + 76'}\n", - "Tool Result: -165566\n", - "[ContentBlock(text='So the final result of evaluating the expression (12851 - 593) * 301 + 76 is 3677034.', type='text')]\n", + "Tool Result: 3689734\n", + "[ContentBlock(text='So the final result of evaluating the expression (12851 - 593) * 301 + 76 is 3689734.', type='text')]\n", "\n", - "Final Response: So the final result of evaluating the expression (12851 - 593) * 301 + 76 is 3677034.\n", + "Final Response: So the final result of evaluating the expression (12851 - 593) * 301 + 76 is 3689734.\n", "\n", "==================================================\n", "User Message: What is 15910385 divided by 193053?\n",