This project is a travel itinerary generator specifically designed for creating detailed travel plans for trips in Pakistan. The generator uses Cohere's AI model to craft itineraries based on user input, considering travel times, routes, local events, national holidays, and other essential factors.
- Create realistic and well-organized itineraries.
- Calculate travel times and suggest feasible routes.
- Provide detailed daily activities and sightseeing spots.
- Include accommodation details for each night.
- Highlight local events and festivals.
- Recommend local cuisine and dining options.
- Consider road conditions and possible delays.
-
Clone the repository:
git clone https://github.com/zshafique25/AI-Travel-Itinerary-Generator.git cd AI-Travel-Itinerary-Generator
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your Cohere API key:
export COHERE_API_KEY='your_cohere_api_key' # On Windows, use set COHERE_API_KEY=your_cohere_api_key
-
Set up your Gemini API key:
export GEMINI_API_KEY='your_gemini_api_key' # On Windows, use set GEMINI_API_KEY=your_gemini_api_key
-
Run the Streamlit app:
streamlit run MusafirAI.py
-
Open your browser and go to
http://localhost:8501
to use the travel itinerary generator.
- MusafiirAI.py: Contains the Streamlit app code for the user interface.
- cohere_model.py: Contains the code for interacting with the Cohere AI model to generate itineraries.
User Interface:
- Step-by-step form to gather trip details:
- Travel locations
- Starting location
- Starting date
- Number of nights
- Accommodation type
- Trip type (Adventure or Laid-back)
- Group size
- Custom CSS for styling:
- Background color
- Text color
- Font size
- Button styling
- Footer design
Backend:
- CohereModel class for interacting with Cohere API:
- Initializing Cohere client
- Creating prompts for itinerary generation
- Generating itineraries using Cohere AI
PDF Generation:
- Functionality to generate a PDF of the itinerary:
- Custom header with a logo
- Itinerary content with a disclaimer note
- Download button for the PDF
Session Management:
- Handling user responses and session state:
- Storing responses for each question
- Navigating between questions
- Generating and displaying the final itinerary