Tutorials
Trip Planning - Workflow
Learn the step-by-step workflow for generating itineraries
3. Main Workflow Steps
1
Get Weather Data
This step:
- Iterates over each location in the input array
- Calls the weather API for each location
2
Search for Tourist Attractions
This step:
- Iterates over the locations again
- Searches for tourist attractions in each location
- Constructs a search query by concatenating “tourist attractions in ” with the location
3
Combine Data
This step:
- Combines the data from previous steps into tuples
- Each tuple contains: (location, weather_data, attractions_data)
- Uses Python’s
zip
function to align the data
4
Generate Itineraries
This step:
- Processes up to 3 locations in parallel
- For each location tuple:
- Sends a prompt to the AI model
- Includes location, weather, and attraction data
- Generates a personalized itinerary
5
Format Final Output
This step:
- Combines all itineraries into a single output
- Separates each itinerary with a divider