Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from Gradio_UI import GradioUI
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
-
def
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
"""A tool that gets the winner for a given Formula1 race
|
| 16 |
Args:
|
|
@@ -21,7 +21,7 @@ def my_custom_tool(venue:str, year:int = 2024)-> str: #it's import to specify th
|
|
| 21 |
session.load()
|
| 22 |
results = session.results
|
| 23 |
winner = results.query('Position'==1.0)['FullName'].values[0]
|
| 24 |
-
return winner
|
| 25 |
|
| 26 |
|
| 27 |
|
|
@@ -58,7 +58,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
-
tools=[final_answer, image_generation_tool,
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|
|
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
+
def get_race_winner(venue:str, year:int = 2024)-> str: #it's import to specify the return type
|
| 14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 15 |
"""A tool that gets the winner for a given Formula1 race
|
| 16 |
Args:
|
|
|
|
| 21 |
session.load()
|
| 22 |
results = session.results
|
| 23 |
winner = results.query('Position'==1.0)['FullName'].values[0]
|
| 24 |
+
return f"The winner of the race in {venue} in {year} was {winner}"
|
| 25 |
|
| 26 |
|
| 27 |
|
|
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
+
tools=[final_answer, image_generation_tool, get_race_winner], ## add your tools here (don't remove final answer)
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|