Skip to content

Commit

Permalink
Merge pull request anthropics#32 from carsonkahn-external/patch-1
Browse files Browse the repository at this point in the history
Escape for valid notebook
  • Loading branch information
alexalbertt committed Apr 8, 2024
2 parents 7f3d907 + aa67060 commit d64821a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tool_use/calculator_tool.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d64821a

Please sign in to comment.