Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,21 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 18 |
"""
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 23 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 18 |
"""
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
+
@tool
|
| 22 |
+
def add_two_numbers(x:int, y:int)-> str:
|
| 23 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 24 |
+
"""A tool that takes two numbers and adds them together
|
| 25 |
+
Args:
|
| 26 |
+
x: the first number
|
| 27 |
+
y: the second number
|
| 28 |
+
"""
|
| 29 |
+
try:
|
| 30 |
+
num_sum = x + y
|
| 31 |
+
return f"The sum of '{x}' and '{y}' is: {num_sum}"
|
| 32 |
+
except Exception as e:
|
| 33 |
+
return f"Error adding '{x}' and '{y}': {str(e)}"
|
| 34 |
+
|
| 35 |
+
|
| 36 |
@tool
|
| 37 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 38 |
"""A tool that fetches the current local time in a specified timezone.
|