https://github.com/dominikwinter/slackgpt
Lightweight Go Slack Bot with OpenAI Assistants API
https://github.com/dominikwinter/slackgpt
assistants-api chatbot chatgpt go golang openai slack slack-bot
Last synced: 5 months ago
JSON representation
Lightweight Go Slack Bot with OpenAI Assistants API
- Host: GitHub
- URL: https://github.com/dominikwinter/slackgpt
- Owner: dominikwinter
- Created: 2024-02-05T12:42:21.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-17T00:30:27.000Z (over 1 year ago)
- Last Synced: 2024-10-19T01:05:24.035Z (over 1 year ago)
- Topics: assistants-api, chatbot, chatgpt, go, golang, openai, slack, slack-bot
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Slack-Bot with OpenAI Assistants API
- [Slack Web API](https://api.slack.com/web)
- [Open AI Assistants API](https://platform.openai.com/docs/assistants/overview)
This is a Slack Bot written in Go. It integrates OpenAI’s latest Assistants API into Slack to respond to messages. The app acts as a web server that listens for incoming messages from Slack, sends these messages to OpenAI’s API, and subsequently sends the AI-generated responses back to Slack.
It uses the new Assistants API from OpenAI with the ability to upload files like PDFs, allowing you to ask questions about the content of the file.
Purposefully, OpenAI and Slack libs were foregone to create a more lightweight application.
Please note that you need to have a Slack account and a workspace to use this app. You also need to have an OpenAI account and an API key. Please edit the `.env` file with your Slack and OpenAI credentials.
## How to Start the Service
To start the SlackGPT service, follow these steps:
### Prerequisites
Ensure that you have the following installed on your local machine:
- [Go](https://golang.org/doc/install)
- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)
### Building the Service
1. **Clone the Repository:**
```sh
git clone https://github.com/yourusername/slackgpt.git
cd slackgpt
```
2. **Build the Project:**
Use the `Makefile` to build the project.
```sh
make
```
3. **Release Build:**
Create a release build for the service.
```sh
make release
```
### Deploying the Service
1. **Copy Files to Server:**
Manually copy the following files to your server using `scp` or any other file transfer method:
- `slackgpt-linux-amd64`
- `docker-compose.yml`
- `.env`
Example using `scp`:
```sh
scp slackgpt-linux-amd64 docker-compose.yml .env youruser@yourserver:/path/to/destination/
```
2. **SSH into Your Server:**
```sh
ssh youruser@yourserver
```
3. **Start the Service:**
Navigate to the directory where you copied the files and run the following command to start the service using Docker Compose:
```sh
docker compose up -d
```