Build an interactive Slackbot HR Assistant using the OpenAI Assistant API, Python, and Flask. This guide will show you how to create a Slackbot that leverages OpenAI's powerful AI capabilities for generating responses and Airtable for data storage.
- OpenAI Account: Sign up for an account at OpenAI if you don't have one.
- Slack App: Create a Slack app at Slack API.
- Digital Ocean: We'll use Digital Ocean for deployment.
- Python Knowledge: Basic understanding of Python programming.
-
Visit Slack API.
-
Create a new App with an App Manifest.
-
Configure your App Manifest as shown below:
{ "display_information": { "name": "HY" }, "features": { "bot_user": { "display_name": "HY", "always_online": true } }, "oauth_config": { "scopes": { "bot": [ "app_mentions:read", "chat:write", "im:history", "users:read" ] } }, "settings": { "event_subscriptions": { "request_url": "https://f526-148-252-141-35.ngrok-free.app/slack/events", "bot_events": [ "app_mention", "message.im" ] }, "org_deploy_enabled": false, "socket_mode_enabled": false, "token_rotation_enabled": false } }
- Obtain your OpenAI API key.
- Insert the SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET into your project.
- Create a new table in Airtable and generate an API token for it.
- Update your project with the Airtable URL.
Deploy the application to the Digital Ocean App
- In your Slack App's settings, go to 'Event Subscriptions'.
- Enter the URL of your deployed application to integrate it with Slack.