Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copy this file to .env and set your OpenAI credentials
OPENAI_API_KEY=sk-your-key-here
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__/
.env
.streamlit/
*.pyc
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,61 @@
# hello-world
first project
# 🧭 AI Travel Agent

A Streamlit application that crafts personalized travel itineraries using OpenAI's generative models. The project is inspired by [ashumishra2104/AI_Travel_agent_Streamlit](https://github.com/ashumishra2104/AI_Travel_agent_Streamlit) and reimagined with a modern OpenAI workflow, fallback itineraries, and downloadable trip plans.

## Features

- Guided sidebar to collect trip preferences such as destination, trip length, travel style, and special requests.
- Generates multi-day itineraries, highlights, packing lists, and travel tips with OpenAI's `gpt-4o-mini` model.
- Automatic fallback itinerary when an API key is not configured so the UI can be previewed locally.
- Expandable day-by-day schedule view with dedicated tabs for packing and travel tips.
- Download buttons for both JSON and Markdown versions of the generated itinerary.

## Prerequisites

- Python 3.9+
- An OpenAI API key with access to the Responses API.

## Getting started

1. **Install dependencies**

```bash
pip install -r requirements.txt
```

2. **Configure environment variables**

```bash
cp .env.example .env
# edit .env and add your OpenAI API key
```

Alternatively, export `OPENAI_API_KEY` directly in your shell or hosting platform.

3. **Run the Streamlit app**

```bash
streamlit run app.py
```

The app will open in your browser at `http://localhost:8501`.

## Usage notes

- When an API key is available, the app requests a structured JSON itinerary from OpenAI. If a network or authentication issue occurs, an informative error is shown and a helpful fallback plan is displayed.
- Use the download buttons to save the generated itinerary as JSON for integrations or Markdown for sharing with travelers.
- Feel free to customize the prompt or add new sections (e.g., budgeting, maps) depending on your needs.

## Project structure

```
.
├── app.py # Streamlit UI and OpenAI integration
├── requirements.txt # Python dependencies
├── .env.example # Environment variable template
└── README.md # Project documentation
```

## License

This project inherits the MIT License from the original repository.
Loading