Zack Saadioui
8/27/2024
bash SLACK_APP_TOKEN=xapp-your-token SLACK_BOT_TOKEN=xoxb-your-token GEN_AI_MODEL_PROVIDER=ollama_chat GEN_AI_MODEL_VERSION=llama3:instruct GEN_AI_API_ENDPOINT=http://localhost:11434/api1 2 3 4 5 6 7 8 9 10 11
Ensure you have **Python 3.11** installed, as it's required to run the bot. ### Step 2: Set Up Your Slack App Next, you’ll need to set up a Slack app to facilitate bot functions. Head over to the [Slack API site](https://api.slack.com/apps) and create a new app: 1. Click on **‘Create New App’** from scratch. 2. Choose a name for your app and the workspace you want to install it. 3. In the app settings, make sure to enable `Socket Mode`, which allows your bot to interact with Slack via Websockets, eliminating the need for a public HTTP endpoint. 4. Add required permissions in **OAuth & Permissions**. For instance, you may need scopes like `chat:write` to send messages and `channels:read` to have your bot join channels. ### Step 3: Configure Your .env File OVERRIDE the default environment configurations in your `.env` file with the necessary API tokens, paying close attention to your Ollama server's address and model settings, like so:
bash python bot.py1 2 3 4
This configuration ensures your Slack bot effectively communicates with your Ollama instance. ### Step 4: Running the Bot Once everything is set up, run your bot using the command specified in the repository. Generally, the command looks like:
1
2
``
Your bot should now be live in your Slack workspace, able to respond to the
1
/faq pricing
1
/summary
Copyright © Arsturn 2024