GitXplorerGitXplorer
g

slack-gpt

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
9a60abc69a088aa0945c0eef157307873239a57f

refactored bot to handle gpt-3.5-turbo

gggendro committed 2 years ago
Unverified
1a87926dc1c21a59af390c8c24a3f66891603b0b

added engine and temperature options

gggendro committed 2 years ago
Unverified
0642e381e63b0ac02ce15dc75c317f736a1d322e

added handling of empty replies

gggendro committed 2 years ago
Unverified
be8ed37d90d49f876e9e53ada662754eb4c86902

added history autosave

gggendro committed 2 years ago
Unverified
a753278a955f06495dae726e9f7a19a3e0cc97e5

updated README and added license

gggendro committed 2 years ago
Unverified
e6aea125ed5b0cabc7e9dcfabaecb2fed2d41c0b

added user tagging option

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.