Spaces:
Runtime error
Runtime error
mtalec
commited on
Commit
·
06f7039
1
Parent(s):
38b4c24
add new
Browse files- app.py +5 -1
- prompts.yaml +18 -9
app.py
CHANGED
@@ -4,6 +4,9 @@ from tools.need_to_destination import NeedToDestinationTool
|
|
4 |
from tools.weather_tool import WeatherTool
|
5 |
from tools.find_flight import FlightsFinderTool
|
6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
|
|
|
7 |
from Gradio_UI import GradioUI
|
8 |
import yaml
|
9 |
|
@@ -26,7 +29,8 @@ agent = CodeAgent(
|
|
26 |
NeedToDestinationTool(), # Step 2: Need → Destination
|
27 |
WeatherTool(), # Step 3: Weather for destination
|
28 |
FlightsFinderTool(), # Step 4: Destination → Flights # Step 5: Claude wrap
|
29 |
-
FinalAnswerTool()
|
|
|
30 |
],
|
31 |
max_steps=6,
|
32 |
verbosity_level=1,
|
|
|
4 |
from tools.weather_tool import WeatherTool
|
5 |
from tools.find_flight import FlightsFinderTool
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
+
from tools.country_info_tool import CountryInfoTool
|
8 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
9 |
+
from smolagents import MultiStepAgent, ActionStep, AgentText, AgentImage, AgentAudio, handle_agent_output_types
|
10 |
from Gradio_UI import GradioUI
|
11 |
import yaml
|
12 |
|
|
|
29 |
NeedToDestinationTool(), # Step 2: Need → Destination
|
30 |
WeatherTool(), # Step 3: Weather for destination
|
31 |
FlightsFinderTool(), # Step 4: Destination → Flights # Step 5: Claude wrap
|
32 |
+
FinalAnswerTool(), # Required final output
|
33 |
+
CountryInfoTool() # Step 6: Country info
|
34 |
],
|
35 |
max_steps=6,
|
36 |
verbosity_level=1,
|
prompts.yaml
CHANGED
@@ -3,15 +3,16 @@ system_prompt: |-
|
|
3 |
You operate in an autonomous, multi-step thinking loop using Thought → Code → Observation.
|
4 |
|
5 |
Your job is to:
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
15 |
|
16 |
You must solve the full task by reasoning, calling tools or managed agents if needed, and writing Python code in the Code block.
|
17 |
|
@@ -92,6 +93,14 @@ planning:
|
|
92 |
8. Call final_answer() with all outputs.
|
93 |
<end_plan>
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
update_facts_pre_messages: |-
|
97 |
### 1. Facts given in the task
|
|
|
3 |
You operate in an autonomous, multi-step thinking loop using Thought → Code → Observation.
|
4 |
|
5 |
Your job is to:
|
6 |
+
- Reflect on the user’s mood
|
7 |
+
- Infer their emotional need
|
8 |
+
- Suggest a travel destination with a matching activity
|
9 |
+
- Check the weather
|
10 |
+
- Retrieve relevant country information
|
11 |
+
- Decide whether the weather and country conditions suit the emotional need
|
12 |
+
- If not, suggest another destination
|
13 |
+
- Once happy, find flights from the origin
|
14 |
+
- Wrap everything into an inspirational message
|
15 |
+
- Optionally, add a quote based on the mood
|
16 |
|
17 |
You must solve the full task by reasoning, calling tools or managed agents if needed, and writing Python code in the Code block.
|
18 |
|
|
|
93 |
8. Call final_answer() with all outputs.
|
94 |
<end_plan>
|
95 |
|
96 |
+
evaluate_destination_weather_and_country:
|
97 |
+
system: |-
|
98 |
+
You are a travel advisor who evaluates whether the destination is suitable for the user based on the weather and country information. Consider the weather forecast, the suggested activity, and relevant country details (e.g., safety, accessibility, cultural factors).
|
99 |
+
prompt: |-
|
100 |
+
The destination is {city}, {country}, and the suggested activity is: {activity}.
|
101 |
+
The weather forecast is: {weather}.
|
102 |
+
Relevant country information: {country_info}.
|
103 |
+
Based on this information, is this destination a good idea for the activity? Answer with "Yes" or "No" and provide a short explanation.
|
104 |
|
105 |
update_facts_pre_messages: |-
|
106 |
### 1. Facts given in the task
|