Skip to content

isweerasingha/ai-assistant-chat-app

Repository files navigation

AI Assistant Chat App ✨

License: MIT Next.js OpenAI

Project Screenshot

🚀 Overview

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.


📋 Features

  • 🧠 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.]

🛠️ Tech Stack


⚙️ Getting Started

Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js (v18.x or later recommended)
  • An OpenAI Platform account to get an API key.

Installation

  1. Clone the repository:

    git clone [https://github.com/](https://github.com/)[your-github-username]/[your-repo-name].git
    cd [your-repo-name]
  2. Install dependencies:

    npm install
    # or yarn install or pnpm install
  3. Set up your environment variables: Create a file named .env.local in the root of your project by copying the example file.

    cp .env.example .env.local
  4. Add your API key: Open the .env.local file 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
  5. Run the development server:

    npm run dev

Open http://localhost:3000 with your browser to see the result!


🔑 Environment Variables

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.

🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is distributed under the MIT License. See LICENSE.txt for more information.


🙏 Acknowledgments

  • OpenAI for creating the powerful Assistant API.
  • Vercel for the incredible Next.js framework.
  • [Add any other acknowledgments here]

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors