Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,22 +33,20 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
Args:
|
| 40 |
-
arg1:
|
|
|
|
| 41 |
"""
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
elif "human" in arg1.lower() and "ai" in arg1.lower():
|
| 48 |
-
return f"{arg1} ... They make a great team: the human brings the creativity and the AI brings the execution... and sometimes a random error message!"
|
| 49 |
-
else:
|
| 50 |
-
return "Why did the AI refuse to work with the human? ... It said they had too many 'bugs' in their thinking!"
|
| 51 |
-
|
| 52 |
|
| 53 |
final_answer = FinalAnswerTool()
|
| 54 |
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
# Below is my attempt to use the structure provided
|
| 37 |
+
@tool
|
| 38 |
+
def my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 39 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 40 |
+
"""A tool that does nothing yet
|
| 41 |
Args:
|
| 42 |
+
arg1: the first argument
|
| 43 |
+
arg2: the second argument
|
| 44 |
"""
|
| 45 |
+
if arg2 > 10:
|
| 46 |
+
joke = arg1 #return a joke about arg1
|
| 47 |
+
else
|
| 48 |
+
joke = "What magic will you build ?"
|
| 49 |
+
return joke
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
final_answer = FinalAnswerTool()
|
| 52 |
|