The PDF Slack Bot is a robust solution for handling PDF files directly within Slack. It enables users to upload PDF files and interact with them by asking questions directly related to the document content. This bot integrates seamlessly with Slack to streamline document handling and improve productivity.
- Upload PDF Files: Mention the bot (e.g.,
@pdf-bot) in Slack to upload a PDF. - Answer Questions: Use the
/askcommand to query information directly from the uploaded documents.
Before setting up the PDF Slack Bot, ensure the following:
- Slack Workspace:
- Admin permissions to install a Slack App.
- Environment:
- Python 3.8+
- Virtual Environment (optional but recommended).
- Dependencies:
Slack SDKPyPDF2(or an equivalent PDF parsing library).Langchain(for advanced processing, optional).OpenAI API(for AI-based features).
$ git clone https://github.com/Cyces-Innovation-Labs/pdf-chat-slack-bot.git
$ cd pdf-chat-slack-bot$ python3 -m venv venv
$ source venv/bin/activate # On Windows: venv\Scripts\activate
$ pip install -r requirements.txtCreate a .env file in the project directory and add the following:
SLACK_BOT_TOKEN=<Your Slack Bot Token>
SLACK_SIGNING_SECRET=<Your Slack Signing Secret>
OPENAI_API_KEY=<Your OpenAI API Key>
$ python manage.py runserver- Add the Bot to Slack:
- Invite the bot to your desired channel with
/invite @pdf-bot.
- Invite the bot to your desired channel with
- Upload a PDF:
- Mention the bot (e.g.,
@pdf-bot) and upload a PDF file in a channel or DM where the bot is present.
- Mention the bot (e.g.,
- Interact with the Bot:
- Use the
/askcommand to ask questions directly about the content of the uploaded PDF.
- Use the