Getting started
Create a Slack AI involves 3 steps- Create slack user
- Set environment variables
- Run the app locally
Step 1: Create Slack user token
Follow the steps given below to fetch your slack user token to get data through Slack APIs:- Create a workspace on Slack if you don’t have one already by clicking here.
- Create a new App on your Slack account by going here.
-
Select
From Scratch, then enter the App Name and select your workspace. -
Navigate to
OAuth & Permissionstab from the left sidebar and go to thescopessection. Add the following scopes underUser Token Scopes: -
Click on the
Install to Workspacebutton underOAuth Tokens for Your Workspacesection in the same page and install the app in your slack workspace. -
After installing the app you will see the
User OAuth Token, save that token as you will need to configure it asSLACK_USER_TOKENfor this demo.
Step 2: Set environment variables
Navigate toapi folder and set your HUGGINGFACE_ACCESS_TOKEN and SLACK_USER_TOKEN in .env.example file. Then rename the .env.example file to .env.
By default, we use
Mixtral model from Hugging Face. However, if you prefer to use OpenAI model, then set OPENAI_API_KEY instead of HUGGINGFACE_ACCESS_TOKEN along with SLACK_USER_TOKEN in .env file, and update the code in api/utils/app.py file to use OpenAI model instead of Hugging Face model.