Tourist Assistant
An interactive voice-enabled tourist guide that provides information about cities, landmarks, and destinations worldwide. This application uses OpenAI's GPT models for text generation and speech features for a natural conversation experience, along with RAG capabilities and Google Places API integration for real-time attraction information.
Features
- Text-based chat interface for asking questions about tourist destinations
- Voice input capability through microphone recording
- Audio responses using OpenAI's text-to-speech technology
- Clean, responsive user interface with Gradio
- RAG (Retrieval-Augmented Generation) system using PDF knowledge base
- Google Places API integration for real-time information about attractions
- Set current location for contextual queries
- Quick access to nearby attractions information
Requirements
- Python 3.9+
- OpenAI API key
- Google Places API key (optional, for location search features)
Installation
- Clone this repository
- Install the required dependencies:
pip install -r requirements.txt - Create a
.envfile in the project directory with your API keys:OPENAI_API_KEY=your_openai_api_key_here GOOGLE_PLACES_API_KEY=your_google_places_api_key_here - (Optional) Add PDF files to the
knowledge-base/directory to enhance the assistant's knowledge about specific locations
Running the Application
Start the application by running:
python tourist-assistant.py
The interface will automatically open in your default web browser. If it doesn't, navigate to the URL shown in the terminal (typically http://127.0.0.1:7860/).
Usage
- Type your question about any tourist destination in the text box
- Or click the microphone button and speak your question
- The assistant will respond with text and spoken audio
- Set your current location using the "Set Location" feature
- Click "Nearby Attractions" to get information about attractions near your current location
- Use the "Refresh Knowledge Base" button to reload PDFs in the knowledge-base directory
- Use the "Clear" button to start a new conversation
Technologies Used
- OpenAI GPT-4o Mini for chat completions
- OpenAI Whisper for speech-to-text
- OpenAI TTS for text-to-speech
- Langchain for RAG implementation
- FAISS for vector storage
- Google Places API for location-based attraction information
- Gradio for the web interface
- pydub for audio processing
