GitXplorerGitXplorer
g

slack-gpt

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
881a0c632827dc28ff8283fa2542855c0d4fd442

integrated DALLE-2

gggendro committed 2 years ago
Unverified
2c8c0ae129cb20524234fc38ba5265981ad052bb

added display of top-k answers and reply modifications

gggendro committed 2 years ago
Unverified
0735d831a42b472a1fdced8fb3735dab17607bd2

added admin enabling history commands and thread specific histories

gggendro committed 2 years ago
Unverified
2db5abe01a9767409ac0d4d91abf6e0ed347eb01

better mode parsing with regex

gggendro committed 2 years ago
Unverified
8943da43be54b9eab487d67df26834665381c831

added conversation history

gggendro committed 2 years ago
Unverified
14690079c86415d72acc1f71da35eb64c5b596dc

divided app into classes

gggendro committed 2 years ago

README

The README file for this repository.

Slack-GPT Bot

Repository for a slack bot app connected to the OpenAI API. Our method is inspired by this blogpost.

Update (09/03/2023) 📢: added the latest Chat Completion engine gpt-3.5-turbo!

Installation

$ git clone https://github.com/ggendro/slack-gpt.git
$ cd slack-gpt
$ pip install -r requirements.txt

Tokens

To connect the bot to Slack and OpenAI, you need a <slack_app_token>, a <slack_bot_token>, and an <openai_api_key>. Follow the following steps to generate them:

1. <slack_app_token>

To obtain the <slack_app_token>, you need to create an app with the Slack API.

You need to give your app the following permissions:

  • app_mentions:read
  • channels:history
  • channels:read
  • chat:write
  • files:write

Enable socket mode and copy the generated token, this is your <slack_app_token>.

2. <slack_bot_token>

Stay in Slack API. Enable "Event Subscription" and subscribe to the "app_mention" bot event.

Generate a Bot User OAuth Token in OAuth & Permissions, this is the <slack_bot_token>.

3. <openai_api_key>

An OpenAI API key is also required and can be obtained on the OpenAI API page. Once obtained, it must be pasted under <openai_api_key> as described in the usage section.

Usage

To launch the server, run the following script:

python app.py --slack_app_token <slack_app_token> --slack_bot_token <slack_bot_token> --openai_api_key <openai_api_key>

You will be able to communicate with the bot in your slack workspace using the name given in your app.