Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,6 +33,17 @@ 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 |
final_answer = FinalAnswerTool()
|
| 38 |
|
|
|
|
| 33 |
except Exception as e:
|
| 34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 35 |
|
| 36 |
+
@tool
|
| 37 |
+
def count_how_many_times_the_appears(arg1:str)-> str: #it's import to specify the return type
|
| 38 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 39 |
+
"""A tool that counts how many times the word the appears in the input arg
|
| 40 |
+
Args:
|
| 41 |
+
arg1: input string argument
|
| 42 |
+
"""
|
| 43 |
+
count = sum(1 for word in arg1.lower().split() if word == "the")
|
| 44 |
+
|
| 45 |
+
return f"The appears {count} times."
|
| 46 |
+
|
| 47 |
|
| 48 |
final_answer = FinalAnswerTool()
|
| 49 |
|