Update app.py
Browse files
app.py
CHANGED
|
@@ -17,17 +17,30 @@ from Gradio_UI import GradioUI
|
|
| 17 |
# ------------------ TOOLS ------------------ #
|
| 18 |
@tool
|
| 19 |
def my_custom_tool(arg1: str, arg2: int) -> str:
|
| 20 |
-
"""
|
|
|
|
|
|
|
| 21 |
Args:
|
| 22 |
-
arg1:
|
| 23 |
-
arg2:
|
|
|
|
|
|
|
|
|
|
| 24 |
"""
|
| 25 |
return f"Received {arg1} and {arg2}"
|
| 26 |
|
| 27 |
|
| 28 |
@tool
|
| 29 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 30 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
try:
|
| 32 |
tz = pytz.timezone(timezone)
|
| 33 |
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
| 17 |
# ------------------ TOOLS ------------------ #
|
| 18 |
@tool
|
| 19 |
def my_custom_tool(arg1: str, arg2: int) -> str:
|
| 20 |
+
"""
|
| 21 |
+
A simple example tool.
|
| 22 |
+
|
| 23 |
Args:
|
| 24 |
+
arg1: A string input.
|
| 25 |
+
arg2: An integer input.
|
| 26 |
+
|
| 27 |
+
Returns:
|
| 28 |
+
A formatted string response.
|
| 29 |
"""
|
| 30 |
return f"Received {arg1} and {arg2}"
|
| 31 |
|
| 32 |
|
| 33 |
@tool
|
| 34 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 35 |
+
"""
|
| 36 |
+
Get the current local time for a given timezone.
|
| 37 |
+
|
| 38 |
+
Args:
|
| 39 |
+
timezone: The timezone name (e.g., 'Asia/Kolkata', 'America/New_York').
|
| 40 |
+
|
| 41 |
+
Returns:
|
| 42 |
+
The current local time as a formatted string.
|
| 43 |
+
"""
|
| 44 |
try:
|
| 45 |
tz = pytz.timezone(timezone)
|
| 46 |
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|