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, sign up here.
-
You will also need to sign up 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.
![image](https://private-user-images.githubusercontent.com/37167103/251091114-40eae6d2-76ed-4fb9-825e-e5286003f4c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MjU1NTUsIm5iZiI6MTcyNDcyNTI1NSwicGF0aCI6Ii8zNzE2NzEwMy8yNTEwOTExMTQtNDBlYWU2ZDItNzZlZC00ZmI5LTgyNWUtZTUyODYwMDNmNGMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDAyMjA1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjNWMwOTQxZjU1YjdjZmIxOWZkZWFkZmIwYjMxMDdjMjljZjcxNzNkZTIwNzJmNjcwYjllMzBmZWZjZDliNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.r6Bw5I3apmkRQXINdo1PjxWFupUv5ycqd1sxb4hn6TE)
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.
![image](https://private-user-images.githubusercontent.com/37167103/251099002-f61641f2-897c-43a8-891f-e7340b9d70e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MjU1NTUsIm5iZiI6MTcyNDcyNTI1NSwicGF0aCI6Ii8zNzE2NzEwMy8yNTEwOTkwMDItZjYxNjQxZjItODk3Yy00M2E4LTg5MWYtZTczNDBiOWQ3MGU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDAyMjA1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJmNjY1N2VhOWJkZDNhMDQ3NjQ1MGQ5MThlZTg3ODkxMTM0ZjZiZWE0YzMwNGM1ZDE3ZjI1YmM2ODFkYzY5MWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MDiVfX4cQEtTTkj8CBlRanzK41hEksb_sP4apN5Hy2s)
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).
![image](https://private-user-images.githubusercontent.com/37167103/251118665-0be8666b-cfb6-4921-bb63-883b9a99e289.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MjU1NTUsIm5iZiI6MTcyNDcyNTI1NSwicGF0aCI6Ii8zNzE2NzEwMy8yNTExMTg2NjUtMGJlODY2NmItY2ZiNi00OTIxLWJiNjMtODgzYjlhOTllMjg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDAyMjA1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUyZjNhYjliODFhNjk2NmE5ZjhiODc1Yjk3MzcwNjljMmYxM2Y2OTgxMDZhMTBkZjUyNjNhZWVmOGIxNTZkNjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Gfjl0iypqslWq39RNQCXqX8k3OpKa06dSla25HfQvSM)
![image](https://private-user-images.githubusercontent.com/37167103/251121215-cb9aadbb-5849-4889-bcc5-1f8dc8376a37.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MjU1NTUsIm5iZiI6MTcyNDcyNTI1NSwicGF0aCI6Ii8zNzE2NzEwMy8yNTExMjEyMTUtY2I5YWFkYmItNTg0OS00ODg5LWJjYzUtMWY4ZGM4Mzc2YTM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDAyMjA1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRlNjY0YTNkZWY3ZDU5Zjc1MjhlZTMyOGI3MWFhMGVmYTY2OGMwMDFiYzgzMTE1YWRjODRmYWJiMjllMWM1ODcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zhzmZCHLJy13aceScbUZpm2VgDdfpU-q3B5rYaABvBU)
Click Build.
![image](https://private-user-images.githubusercontent.com/37167103/251121925-b8c32f02-5ead-4344-95fc-a3d09f0da0b1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MjU1NTUsIm5iZiI6MTcyNDcyNTI1NSwicGF0aCI6Ii8zNzE2NzEwMy8yNTExMjE5MjUtYjhjMzJmMDItNWVhZC00MzQ0LTk1ZmMtYTNkMDlmMGRhMGIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI3VDAyMjA1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3NDM3OWU0MzdkOTBhNTdhNDY0ZWJjYzVhMTNkZjkxMGUxMTJkNDdkNzI5NzRlOWU5ZWMzYmUxMzBlMzliMGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.X3bbrA2n6q17ApShBAieowc5RD2SDI9GJgAtdKH0Evc)
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!