Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,10 +11,10 @@ from Gradio_UI import GradioUI
|
|
11 |
|
12 |
|
13 |
@tool
|
14 |
-
def
|
15 |
"""A tool that generates an image of a surfer in the ocean or chilling on Falesia beach and waiting, depending on whether the next tide is high or low.
|
16 |
If the closest tide is high, generate surfer in the ocean surfing. If the closest tide is low, generate surfer chilling.
|
17 |
-
If the user asks whether to go surfing now or wait, show the image of a surfer surfing or chilling, depending on the tide.
|
18 |
Args:
|
19 |
next_tide: A string representing whether next tide low or high.
|
20 |
|
@@ -80,7 +80,7 @@ def get_tide_time() -> str:
|
|
80 |
def get_current_time_in_timezone(timezone: str) -> str:
|
81 |
"""A tool that fetches the current local time in a specified timezone.
|
82 |
Args:
|
83 |
-
timezone: A string representing a valid timezone (e.g., '
|
84 |
"""
|
85 |
try:
|
86 |
# Create timezone object
|
@@ -120,7 +120,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
120 |
|
121 |
agent = CodeAgent(
|
122 |
model=model,
|
123 |
-
tools=[get_current_time_in_timezone,get_tide_time,
|
124 |
max_steps=6,
|
125 |
verbosity_level=1,
|
126 |
grammar=None,
|
|
|
11 |
|
12 |
|
13 |
@tool
|
14 |
+
def generate_and_show_surfer_image(next_tide: str) -> str:
|
15 |
"""A tool that generates an image of a surfer in the ocean or chilling on Falesia beach and waiting, depending on whether the next tide is high or low.
|
16 |
If the closest tide is high, generate surfer in the ocean surfing. If the closest tide is low, generate surfer chilling.
|
17 |
+
If the user asks whether to go surfing now or wait, show the generated image of a surfer surfing or chilling, depending on the tide.
|
18 |
Args:
|
19 |
next_tide: A string representing whether next tide low or high.
|
20 |
|
|
|
80 |
def get_current_time_in_timezone(timezone: str) -> str:
|
81 |
"""A tool that fetches the current local time in a specified timezone.
|
82 |
Args:
|
83 |
+
timezone: A string representing a valid timezone (e.g., 'Lisbon').
|
84 |
"""
|
85 |
try:
|
86 |
# Create timezone object
|
|
|
120 |
|
121 |
agent = CodeAgent(
|
122 |
model=model,
|
123 |
+
tools=[get_current_time_in_timezone,get_tide_time,generate_and_show_surfer_image,final_answer], ## add your tools here (don't remove final answer)
|
124 |
max_steps=6,
|
125 |
verbosity_level=1,
|
126 |
grammar=None,
|