Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raheesahmed/openai-assistant-api-with-ui
This project is an Express.js server integrated with OpenAI's API. It includes features such as file uploading, creating and managing an OpenAI assistant, and handling chat interactions using the assistant.
https://github.com/raheesahmed/openai-assistant-api-with-ui
assistantapi chatgpt4 openai openai-assistant-api openai-assistant-api-chatbot openai-assistants openai-chatgpt
Last synced: about 1 month ago
JSON representation
This project is an Express.js server integrated with OpenAI's API. It includes features such as file uploading, creating and managing an OpenAI assistant, and handling chat interactions using the assistant.
- Host: GitHub
- URL: https://github.com/raheesahmed/openai-assistant-api-with-ui
- Owner: RaheesAhmed
- Created: 2023-12-06T01:35:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-07T15:26:40.000Z (about 1 year ago)
- Last Synced: 2024-11-06T12:39:53.923Z (3 months ago)
- Topics: assistantapi, chatgpt4, openai, openai-assistant-api, openai-assistant-api-chatbot, openai-assistants, openai-chatgpt
- Language: JavaScript
- Homepage:
- Size: 271 KB
- Stars: 22
- Watchers: 1
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenAI Assistant API Integration
This project is an Express.js server integrated with OpenAI's API. It includes features such as file uploading, creating and managing an OpenAI assistant, and handling chat interactions using the assistant.
![alt text](./design-images/screenshot.PNG)
![alt text](./design-images/chat-design.PNG)
## Introduction
The server is designed to interact with OpenAI's API, providing an interface for chat functionalities and file management. It uses `multer` for handling file uploads, `body-parser` and `cors` for middleware support, and `dotenv` for environment variable management.
## Installation
To get started with this project, follow these steps:
1. Clone the repository:
```
git clone https://github.com/RaheesAhmed/OpenAI-Assistant-API-with-UI.git
```
cd frontend```
npm install
```cd backend:
```
npm install
```2. Install dependencies:
```
npm install
```Create a `.env` file in the root directory and add your OpenAI API key:
` OPENAI_API_KEY=your_api_key_here`2. Starting the Server
Run the server using the following command:```
npm start
```This will start the server on the default port 3000 or on a port specified in the .env file.
# API Endpoints
`POST /chat`
Description: Sends a chat question to the OpenAI assistant and returns its response.
Payload: `{ "question": "Your question here" }`
`POST /upload`Description: Uploads a file to be used with the OpenAI assistant.
Form-data: file: [Your File Here]## Contributing
Contributions to this project are welcome. Please ensure to follow the existing code style and add unit tests for any new or changed functionality