Update app.py
Browse files
app.py
CHANGED
|
@@ -9,13 +9,21 @@ 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 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
@tool
|
| 21 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -54,7 +62,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 54 |
|
| 55 |
agent = CodeAgent(
|
| 56 |
model=model,
|
| 57 |
-
tools=[get_current_time_in_timezone,final_answer], ## add your tools here (don't remove final answer)
|
| 58 |
max_steps=6,
|
| 59 |
verbosity_level=1,
|
| 60 |
grammar=None,
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def calculate_walking_time_paris(start, end):
|
| 13 |
+
# This is a placeholder function. In a real scenario, this function would call a tool to get the actual walking time.
|
| 14 |
+
# For now, we'll use predefined walking times for simplicity.
|
| 15 |
+
walking_times = {
|
| 16 |
+
("Eiffel Tower", "Champ de Mars"): 9,
|
| 17 |
+
("Champ de Mars", "Musée de l'Orangerie"): 11,
|
| 18 |
+
("Musée de l'Orangerie", "Pont Alexandre III"): 8,
|
| 19 |
+
("Pont Alexandre III", "Grand Palais"): 12,
|
| 20 |
+
("Grand Palais", "Jardins du Trocadéro"): 10,
|
| 21 |
+
("Jardins du Trocadéro", "Eiffel Tower"): 10,
|
| 22 |
+
("Eiffel Tower", "Musée Rodin"): 18,
|
| 23 |
+
("Musée Rodin", "Pont de l'Alma"): 7,
|
| 24 |
+
("Pont de l'Alma", "Basilique du Sacré-Cœur"): 13
|
| 25 |
+
}
|
| 26 |
+
return walking_times.get((start, end), 20)
|
| 27 |
|
| 28 |
@tool
|
| 29 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 62 |
|
| 63 |
agent = CodeAgent(
|
| 64 |
model=model,
|
| 65 |
+
tools=[get_current_time_in_timezone,calculate_walking_time_paris,final_answer], ## add your tools here (don't remove final answer)
|
| 66 |
max_steps=6,
|
| 67 |
verbosity_level=1,
|
| 68 |
grammar=None,
|