FinancialStrategist / crewai /tools /calculator_tools.py
eaglelandsonce's picture
Upload 22 files
025a7d5
raw
history blame
No virus
374 Bytes
from langchain.tools import tool
class CalculatorTools():
@tool("Make a calcualtion")
def calculate(operation):
"""Useful to perform any mathematica calculations,
like sum, minus, mutiplcation, 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)