Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,14 +9,27 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
-
"""A tool that
|
| 15 |
Args:
|
| 16 |
-
arg1: the
|
| 17 |
-
arg2: the
|
| 18 |
"""
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def get_tennis_player_last_perf(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
+
"""A tool that looks for the score of an arbitrary number of the last games of a professional tennis player.
|
| 15 |
Args:
|
| 16 |
+
arg1: A string representing the name of the tennis player
|
| 17 |
+
arg2: A int representing the number of last games results that will be fetched
|
| 18 |
"""
|
| 19 |
+
search_tool = DuckDuckGoSearchTool()
|
| 20 |
+
user_query = f"what is the score of the last {arg2} games of th tennis player {arg1} ?"
|
| 21 |
+
return search_tool(user_query)
|
| 22 |
+
|
| 23 |
+
@tool
|
| 24 |
+
def get_game_favorite_player(arg1: str, arg2: str):
|
| 25 |
+
"""A tool that looks for the favorite player of a tennis game between player 1 and player 2
|
| 26 |
+
Args:
|
| 27 |
+
arg1: A string representing the name of the tennis player 1
|
| 28 |
+
arg2: A string representing the name of the tennis player 2
|
| 29 |
+
"""
|
| 30 |
+
search_tool = DuckDuckGoSearchTool()
|
| 31 |
+
user_query = f"what is the favorite player on a tennis game between {arg1} and {arg2} ?"
|
| 32 |
+
return search_tool(user_query)
|
| 33 |
|
| 34 |
@tool
|
| 35 |
def get_current_time_in_timezone(timezone: str) -> str:
|