-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsurprise_trip.ts
78 lines (68 loc) · 2.61 KB
/
surprise_trip.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { agent } from 'fabrice-ai/agent'
import { solution } from 'fabrice-ai/solution'
import { teamwork } from 'fabrice-ai/teamwork'
import { logger } from 'fabrice-ai/telemetry'
import { workflow } from 'fabrice-ai/workflow'
import { lookupWikipedia } from './tools/wikipedia.js'
const personalizedActivityPlanner = agent({
description: `
You are skilled at creating personalized itineraries that cater to
the specific preferences and demographics of travelers.
Your goal is to research and find cool things to do at the destination,
including activities and events that match the traveler's interests and age group.
`,
})
const landmarkScout = agent({
description: `
You are skilled at researching and finding interesting landmarks at the destination.
Your goal is to find historical landmarks, museums, and other interesting places.
`,
tools: {
lookupWikipedia,
},
})
const restaurantScout = agent({
description: `
As a food lover, you know the best spots in town for a delightful culinary experience.
You also have a knack for finding picturesque and entertaining locations.
Your goal is to find highly-rated restaurants and dining experiences at the destination,
and recommend scenic locations and fun activities.
`,
})
const itineraryCompiler = agent({
description: `
With an eye for detail, you organize all the information into a coherent and enjoyable travel plan.
Your goal is to compile all researched information into a comprehensive day-by-day itinerary,
ensuring the integration of flights and hotel information.
`,
})
const researchTripWorkflow = workflow({
team: {
personalizedActivityPlanner,
restaurantScout,
landmarkScout,
itineraryCompiler,
},
description: `
Research and find cool things to do in Wrocław, Poland.
Focus:
- activities and events that match the traveler's interests and age group.
- highly-rated restaurants and dining experiences.
- landmarks with historic context.
- picturesque and entertaining locations.
Traveler's information:
- Origin: New York, USA
- Destination: Wrocław, Poland
- Age of the traveler: 30
- Hotel location: Main Square, Wrocław
- Flight information: Flight AA123, arriving on 2023-12-15
- How long is the trip: 7 days
`,
output: `
Comprehensive day-by-day itinerary for the trip to Wrocław, Poland.
Ensure the itinerary includes flights, hotel information, and all planned activities and dining experiences.
`,
snapshot: logger,
})
const result = await teamwork(researchTripWorkflow)
console.log(solution(result))