Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,13 +34,12 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
@tool
|
37 |
-
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
func=get_weather,
|
42 |
-
description="Gets real-time weather data for a given city"
|
43 |
-
)
|
44 |
|
45 |
|
46 |
final_answer = FinalAnswerTool()
|
@@ -64,7 +63,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
64 |
|
65 |
agent = CodeAgent(
|
66 |
model=model,
|
67 |
-
tools=[final_answer,
|
68 |
max_steps=6,
|
69 |
verbosity_level=1,
|
70 |
grammar=None,
|
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
@tool
|
37 |
+
# Extract current weather information from AccuWeather
|
38 |
+
weather_info = weather_result.split('\n')[1] # The second line contains the current weather information
|
39 |
+
print("Current Weather in Franconia, Virginia:", weather_info)
|
40 |
|
41 |
+
# Combine the current time and weather information for the final answer
|
42 |
+
final_answer(f"Current Time: {current_time}\nCurrent Weather: {weather_info}")
|
|
|
|
|
|
|
43 |
|
44 |
|
45 |
final_answer = FinalAnswerTool()
|
|
|
63 |
|
64 |
agent = CodeAgent(
|
65 |
model=model,
|
66 |
+
tools=[final_answer,weather_info,image_generation_tool,get_current_time_in_timezone,DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
67 |
max_steps=6,
|
68 |
verbosity_level=1,
|
69 |
grammar=None,
|