Deploy this function on flows.network, and you will get a Slack bot that uses ChatGPT to respond to every question in your Slack workspace automatically. Below is an example:
- Create a bot from a template
- Authenticate your Slack
- Add your OpenAI API key
-
You will need to bring your own OpenAI API key. If you do not already have one, # here.
-
You will also need to # for flows.network with your GitHub account. It is free.
You can customize the repo name. You will fork this template repo to your GitHub.
Click on the Create and Build button.
Click the "+ Authenticate" button to authorize your Slack account.
You'll enter which Slack channel you want your bot to be deployed in.
slack_channel
: Slack channel where you want to deploy the bot. Case sensitive.slack_workspace
: Slack organization of the Slack channel where you want to deploy the bot. Case sensitive.
Enter your Slack workspace and channel respectively in the red boxes below.
Next, let's grant flows.network to access the Slack channel you just entered. The Slack channel must be public.
Click the "Connect/+ Add new authentication" button to authenticate your Slack account. You'll be redirected to a new page where you must grant flows.network permission to install the flows-network
bot on your workspace. This workspace is the one you entered into the slack_workspace
above.
Click the "Connect" button to authenticate your OpenAI account. You'll be redirected to a new page where you can copy and paste your OpenAI API key.
Close the tab and go back to the flow.network page once you are done. Click Deploy.
As soon as the flow function's status becomes running
, the ChatGPT Slack bot goes live. Go ahead and chat with ChatGPT by sending a message in the channel!
The bot's source code is available in the GitHub repo you cloned from the template. Feel free to make changes to the source code (e.g., model, context length, API key and prompts) to fit your own needs. If you need help, ask in Discord!
By default, the bot uses GPT3.5. If your OpenAI API key has access to GPT4, you can open the src/lib.rs
file
in your cloned source code repo, and change GPT35Turbo
to GPT4
in the source code. Commit and push the change back to GitHub.
The flows.network platform will automatically detect and rebuild the bot from your updated source code.
You can manually create a new flow and import the source code repo for the bot (i.e., the repo you cloned from the template).
Choose a template repo and enter the `slack_channel` and `slack_workspace` to point to the target slack channel you need to deploy the bot in.Click Build.
You have already authorized the access to your Slack. Click Continue.
You have already entered your OpenAI key before. click Deploy.
You can repeat this for all target slack channels you would like to deploy this bot in.
You can have a single flow function repo deployed as the source code for multiple bots. When you update the source code in the repo, and push it to GitHub, it will change the behavior of all the bots.
flows.network is still in its early stages. We would love to hear your feedback!