This project is a web-based chat application built with Next.js. It leverages the power of the OpenAI Assistant API to create a persistent and intelligent conversational experience. Users can ask questions, get detailed answers, and have a natural dialogue with an AI assistant.
- 🧠 Intelligent Conversations: Utilizes the stateful OpenAI Assistant API to remember context and provide relevant responses.
- ⚡️ Fast & Responsive: Built with Next.js for a speedy user experience and server-side rendering.
- 💬 Real-time Chat Interface: A clean and intuitive UI for seamless interaction.
- 🎨 Modern Tech Stack: Uses Next.js 14 App Router, React, and Tailwind CSS.
- 🔒 Secure API Handling: All OpenAI API calls are securely handled on the backend via Next.js API routes.
- [Add another feature, e.g., File Uploads for context, Code Interpretation, etc.]
- Framework: Next.js
- Styling: Tailwind CSS
- AI: OpenAI Assistant API
- Language: TypeScript
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- Node.js (v18.x or later recommended)
- An OpenAI Platform account to get an API key.
-
Clone the repository:
git clone [https://github.com/](https://github.com/)[your-github-username]/[your-repo-name].git cd [your-repo-name] -
Install dependencies:
npm install # or yarn install or pnpm install -
Set up your environment variables: Create a file named
.env.localin the root of your project by copying the example file.cp .env.example .env.local
-
Add your API key: Open the
.env.localfile and add your OpenAI API key.# .env.local OPENAI_API_KEY="sk-..." OPENAI_ASSISTANT_ID="asst_..." # Optional: Add if you have a pre-configured Assistant ID
-
Run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result!
To run this project, you will need to add the following environment variables to your .env.local file:
OPENAI_API_KEY: Your secret API key from the OpenAI Platform.OPENAI_ASSISTANT_ID: (Optional) If you have already created an Assistant on the OpenAI platform, you can specify its ID here. If not, the application can be configured to create one on the fly.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is distributed under the MIT License. See LICENSE.txt for more information.
