File size: 300 Bytes
8950c51 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from langchain_core.tools import tool
import cmath
@tool
def square_root(a: float) -> float | complex:
"""
Get the square root of a number.
Args:
a (float): the number to get the square root of
"""
if a >= 0:
return a**0.5
return cmath.sqrt(a)
|