A modern, reusable template for building AI-powered chat applications using Flask and Azure OpenAI.
- Modern, responsive UI with Tailwind CSS
- Real-time chat using WebSocket
- Azure OpenAI integration
- Environment configuration
- Structured message handling
- Markdown and table support in responses
- Loading states and animations
- Error handling
- Clone this template
- Copy
.env.template
to.env
and fill in your Azure OpenAI credentials - Install dependencies:
pip install -r requirements.txt
- Run the application:
- Development mode:
python app.py
- Production mode:
python app.py --prod
- Development mode:
Create a .env
file with the following variables:
AZURE_OPENAI_API_KEY=your-api-key
AZURE_OPENAI_ENDPOINT=your-endpoint
AZURE_OPENAI_API_VERSION=2023-05-15
FLASK_SECRET_KEY=your-secret-key
ovid/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── .env.template # Environment variables template
├── static/
│ ├── css/
│ │ └── style.css # Custom styles
│ └── js/
│ └── chat.js # Chat functionality
└── templates/
└── chat.html # Chat interface
- Modify
templates/chat.html
for UI changes - Update
static/css/style.css
for custom styling - Adjust Azure OpenAI parameters in
app.py
- Modify system prompts in
app.py
Feel free to submit issues and enhancement requests!