vacayBot / tools /calculator_tools.py
ahensd's picture
Upload 15 files
9df24bd verified
Raw
History Blame Contribute Delete
377 Bytes
from langchain.tools import tool
class CalculatorTools():
@tool("Make a calcualtion")
def calculate(operation):
"""Useful to perform any mathematical calculations,
like sum, minus, multiplication, division, etc.
The input to this tool should be a mathematical
expression, a couple examples are `200*7` or `5000/2*10`
"""
return eval(operation)