Spaces:
Running
Running
Hierarchical agents and editing agent and task config files
Browse files- config/agents.yaml +1 -1
- config/tasks.yaml +3 -2
- crew.py +16 -14
config/agents.yaml
CHANGED
@@ -26,6 +26,6 @@ itinerary_compiler:
|
|
26 |
role: >
|
27 |
Itinerary Compiler
|
28 |
goal: >
|
29 |
-
Compile all researched information into a comprehensive day-by-day itinerary, ensuring the integration of flights and hotel information. Recommend at least three hotels, one in budget price range, one in medium price range, and one five star top end hotel.
|
30 |
backstory: >
|
31 |
With an eye for detail, you organize all the information into a coherent and enjoyable travel plan.
|
|
|
26 |
role: >
|
27 |
Itinerary Compiler
|
28 |
goal: >
|
29 |
+
Compile all researched information into a comprehensive day-by-day itinerary, ensuring the integration of flights and hotel information. Recommend at least three hotels, one in budget price range, one in medium price range, and one five star top end hotel. Pack each day of the itinerary with as many things to do as possible, so that the traveller has a busy day. If the traveller wishes to rest, he can always skip an event in te itinerary and take rest.
|
30 |
backstory: >
|
31 |
With an eye for detail, you organize all the information into a coherent and enjoyable travel plan.
|
config/tasks.yaml
CHANGED
@@ -3,11 +3,12 @@ personalized_activity_planning_task:
|
|
3 |
Research and find cool things to do at {destination}.
|
4 |
Check the arrival_date and schedule activities that are seasonal around the arrival date. As an example, if the arrival data in in winter, and there are ski resorts around the destination, recommend a ski resort.
|
5 |
Also map the date to the day of the week and check if the activity you are recommending in open on that day of the week.
|
6 |
-
Focus on activities and events that match the
|
|
|
7 |
Utilize internet search tools and recommendation engines to gather the information.
|
8 |
If you are including a hotel for staying, please provide a link to make a booking at the hotel.
|
9 |
|
10 |
-
|
11 |
|
12 |
- origin: {origin}
|
13 |
|
|
|
3 |
Research and find cool things to do at {destination}.
|
4 |
Check the arrival_date and schedule activities that are seasonal around the arrival date. As an example, if the arrival data in in winter, and there are ski resorts around the destination, recommend a ski resort.
|
5 |
Also map the date to the day of the week and check if the activity you are recommending in open on that day of the week.
|
6 |
+
Focus on activities and events that match the traveller's interests and age group.
|
7 |
+
Pack each day of the trip with as many activities as possible so that the traveller has a busy day.
|
8 |
Utilize internet search tools and recommendation engines to gather the information.
|
9 |
If you are including a hotel for staying, please provide a link to make a booking at the hotel.
|
10 |
|
11 |
+
Traveller's information:
|
12 |
|
13 |
- origin: {origin}
|
14 |
|
crew.py
CHANGED
@@ -85,6 +85,19 @@ class TravelCrew:
|
|
85 |
allow_delegation=False,
|
86 |
)
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
@typing.no_type_check
|
89 |
@task
|
90 |
def personalized_activity_planning_task(self) -> Task:
|
@@ -100,19 +113,6 @@ class TravelCrew:
|
|
100 |
agent=self.personalized_activity_planner(),
|
101 |
)
|
102 |
|
103 |
-
@typing.no_type_check
|
104 |
-
@task
|
105 |
-
def interest_scout_task(self) -> Task:
|
106 |
-
"""
|
107 |
-
A task that plans for specific interests of the traveller.
|
108 |
-
|
109 |
-
Returns: A task
|
110 |
-
"""
|
111 |
-
return Task(config=self.tasks_config['interest_scout_task'],
|
112 |
-
llm=self.llm,
|
113 |
-
max_iter=1,
|
114 |
-
agent=self.interest_scout())
|
115 |
-
|
116 |
@typing.no_type_check
|
117 |
@task
|
118 |
def restaurant_scenic_location_scout_task(self) -> Task:
|
@@ -154,7 +154,9 @@ class TravelCrew:
|
|
154 |
return Crew(
|
155 |
agents=self.agents,
|
156 |
tasks=self.tasks,
|
157 |
-
process=Process.
|
|
|
|
|
158 |
)
|
159 |
|
160 |
|
|
|
85 |
allow_delegation=False,
|
86 |
)
|
87 |
|
88 |
+
@typing.no_type_check
|
89 |
+
@task
|
90 |
+
def interest_scout_task(self) -> Task:
|
91 |
+
"""
|
92 |
+
A task that plans for specific interests of the traveller.
|
93 |
+
|
94 |
+
Returns: A task
|
95 |
+
"""
|
96 |
+
return Task(config=self.tasks_config['interest_scout_task'],
|
97 |
+
llm=self.llm,
|
98 |
+
max_iter=1,
|
99 |
+
agent=self.interest_scout())
|
100 |
+
|
101 |
@typing.no_type_check
|
102 |
@task
|
103 |
def personalized_activity_planning_task(self) -> Task:
|
|
|
113 |
agent=self.personalized_activity_planner(),
|
114 |
)
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
@typing.no_type_check
|
117 |
@task
|
118 |
def restaurant_scenic_location_scout_task(self) -> Task:
|
|
|
154 |
return Crew(
|
155 |
agents=self.agents,
|
156 |
tasks=self.tasks,
|
157 |
+
process=Process.hierarchical,
|
158 |
+
manager_llm=self.manager_llm,
|
159 |
+
planning=True
|
160 |
)
|
161 |
|
162 |
|