Update agents/tools/deterministic_tools.py
Browse files
agents/tools/deterministic_tools.py
CHANGED
|
@@ -14,9 +14,11 @@ class DeterministicTools():
|
|
| 14 |
Returns:
|
| 15 |
number: Result
|
| 16 |
"""
|
| 17 |
-
print(f"π€ add_tool: {a}, {b}")
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@tool("Subtract Tool")
|
| 22 |
def subtract_tool(a: float, b: float) -> float:
|
|
@@ -29,9 +31,11 @@ class DeterministicTools():
|
|
| 29 |
Returns:
|
| 30 |
number: Result
|
| 31 |
"""
|
| 32 |
-
print(f"π€ subtract_tool: {a}, {b}")
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
|
| 36 |
@tool("Multiply Tool")
|
| 37 |
def multiply_tool(a: float, b: float) -> float:
|
|
@@ -43,9 +47,11 @@ class DeterministicTools():
|
|
| 43 |
Returns:
|
| 44 |
number: Result
|
| 45 |
"""
|
| 46 |
-
print(f"π€ multiply_tool: {a}, {b}")
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
|
| 50 |
@tool("Divide Tool")
|
| 51 |
def divide_tool(a: float, b: float) -> float:
|
|
@@ -61,12 +67,14 @@ class DeterministicTools():
|
|
| 61 |
Raises:
|
| 62 |
RuntimeError: If processing fails
|
| 63 |
"""
|
| 64 |
-
print(f"π€ divide_tool: {a}, {b}")
|
| 65 |
|
| 66 |
if b == 0:
|
| 67 |
raise RuntimeError("Cannot divide by zero.")
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
|
| 71 |
@tool("Modulus Tool")
|
| 72 |
def modulus_tool(a: float, b: float) -> float:
|
|
@@ -79,6 +87,8 @@ class DeterministicTools():
|
|
| 79 |
Returns:
|
| 80 |
number: Result
|
| 81 |
"""
|
| 82 |
-
print(f"π€ modulus_tool: {a}, {b}")
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
|
|
| 14 |
Returns:
|
| 15 |
number: Result
|
| 16 |
"""
|
| 17 |
+
print(f"π€ DeterministicTools: add_tool: a={a}, b={b}")
|
| 18 |
|
| 19 |
+
result = a + b
|
| 20 |
+
print(f"π€ Result: {result}")
|
| 21 |
+
return result
|
| 22 |
|
| 23 |
@tool("Subtract Tool")
|
| 24 |
def subtract_tool(a: float, b: float) -> float:
|
|
|
|
| 31 |
Returns:
|
| 32 |
number: Result
|
| 33 |
"""
|
| 34 |
+
print(f"π€ DeterministicTools: subtract_tool: a={a}, b={b}")
|
| 35 |
|
| 36 |
+
result = a - b
|
| 37 |
+
print(f"π€ Result: {result}")
|
| 38 |
+
return result
|
| 39 |
|
| 40 |
@tool("Multiply Tool")
|
| 41 |
def multiply_tool(a: float, b: float) -> float:
|
|
|
|
| 47 |
Returns:
|
| 48 |
number: Result
|
| 49 |
"""
|
| 50 |
+
print(f"π€ DeterministicTools: multiply_tool: a={a}, b={b}")
|
| 51 |
|
| 52 |
+
result = a * b
|
| 53 |
+
print(f"π€ Result: {result}")
|
| 54 |
+
return result
|
| 55 |
|
| 56 |
@tool("Divide Tool")
|
| 57 |
def divide_tool(a: float, b: float) -> float:
|
|
|
|
| 67 |
Raises:
|
| 68 |
RuntimeError: If processing fails
|
| 69 |
"""
|
| 70 |
+
print(f"π€ DeterministicTools: divide_tool: a={a}, b={b}")
|
| 71 |
|
| 72 |
if b == 0:
|
| 73 |
raise RuntimeError("Cannot divide by zero.")
|
| 74 |
|
| 75 |
+
result = a / b
|
| 76 |
+
print(f"π€ Result: {result}")
|
| 77 |
+
return result
|
| 78 |
|
| 79 |
@tool("Modulus Tool")
|
| 80 |
def modulus_tool(a: float, b: float) -> float:
|
|
|
|
| 87 |
Returns:
|
| 88 |
number: Result
|
| 89 |
"""
|
| 90 |
+
print(f"π€ DeterministicTools: modulus_tool: a={a}, b={b}")
|
| 91 |
|
| 92 |
+
result = a % b
|
| 93 |
+
print(f"π€ Result: {result}")
|
| 94 |
+
return result
|