This project provides a complete starter template for building AI-powered chat applications using Next.js and Azure OpenAI. It features a customizable chat interface with streaming responses and intelligent query classification.
- 🤖 Intelligent query classification (general, refund, technical)
- 🔄 Streaming responses for real-time interaction
- 📱 Responsive, modern UI that works on all devices
- 🧠 Adaptive model selection based on query complexity
- 🎭 Dynamic AI agent personalities based on query type
- Clone this repository
- Rename
.example.env.local
to.env.local
and update your Azure OpenAI credentials:
AZURE_OPENAI_RESOURCE_NAME=your-resource-name
AZURE_OPENAI_API_KEY=your-api-key
- Install dependencies and start the development server:
npm install
npm run dev
- Open http://localhost:3000 in your browser
app/(chat)/page.tsx
: The main chat interfaceapp/(chat)/api/chat/route.ts
: API route containing the agent logic and LLM callscomponents/
: Reusable UI componentspublic/
: Static assets including images
You can easily customize this template:
- Modify the agent logic in
app/(chat)/api/chat/route.ts
- Change the classification types and prompts
- Adjust the UI in
app/(chat)/page.tsx
- Replace models with different Azure OpenAI deployments
MIT
- Built with Next.js
- Powered by Azure OpenAI
- UI components styled with Tailwind CSS