A real-time audio chat application using OpenAI's realtime audio API with WebRTC. Ask about the weather in any location and get real-time responses using Open-Meteo API.
- Real-time audio streaming
- Live transcription
- Weather function integration
- WebRTC communication
- FastAPI backend to get a ephemeral session token and to get weather data
- Clone the repository
- Create a virtual environment:
python -m venv .venv
- Activate it:
- Windows:
.venv\Scripts\activate
- Unix/macOS:
source .venv/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt
- Create
.env
file with your OpenAI API key:
OPENAI_API_KEY=your-key-here
- Start server:
python app.py
- Open index.html in a browser (Tip: use live server extension for VSCode)
- Click Start and allow microphone access
- Try asking: "What's the weather like in Amsterdam?"
- app.py: FastAPI backend server
- index.html: Frontend interface
- requirements.txt: Python dependencies
- test.http: API endpoint tests
- .env: Environment variables (create this)
- For development use only
- Never commit your .env file
- Requires OpenAI API key
- Uses Open-Meteo API for weather data