This project is an AI-powered customer support application built with Next.js and OpenAI.
- Node.js (version 14 or higher)
- npm or yarn
- OpenAI API key
-
Clone the repository:
git clone https://github.com/your-username/ai_customer_support.git cd ai_customer_support -
Install dependencies:
npm installor
yarn install -
Create a
.env.localfile in the root directory and add your OpenAI API key:OPEN_AI_KEY=your_openai_api_key_here -
Start the development server:
npm run devor
yarn dev -
Open your browser and navigate to
http://localhost:3000to see the application running.
app/: Contains the main application codeapi/: API routescomponents/: React componentslayout.js: Root layout componentpage.js: Main page component
public/: Static assetsapp/SystemPrompt.js: Contains the system prompt for the AI
- AI-powered customer support chat
- Persistent chat history using
ChatMessageHistory - Integration with OpenAI's GPT-4 model
POST /api/chat: Handles chat messages and returns AI responses
You can customize the AI behavior by modifying the system prompt in app/SystemPrompt.js.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.