The Open-Source Slack AI App

Jan 8, 2022 | Educational

Welcome to the world of AI-enhanced communication! This blog will guide you through the process of setting up your very own open-source Slack AI app, enabling you to summarize threads and channels on command using OpenAI technologies. Let’s embark on this journey of making your Slack workspace smarter!

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Installation

  1. Clone the repository to your local machine.
  2. Navigate to the project directory.
  3. Install the required Python packages using Poetry:
  4. poetry install
  5. Install the dictionary model:
  6. poetry run python -m spacy download en_core_web_md
  7. Create a .env file in the root directory of the project, and fill it with your API keys and tokens. Use the example.env file as a template:
  8. cp example.env .env
    open .env

Slack App Configuration

Make a copy of manifest.json and change the request URL to your ngrok or server URL. Create a new Slack app here and configure it using your manifest.yaml file. You can adjust the name and description as needed. Make sure to retrieve the Bot User OAuth Token from the Install App page and add it to your .env file as SLACK_BOT_TOKEN.

Usage

To run the application, start the FastAPI server:

poetry run uvicorn ossai.slack_server:app --reload

Next, expose the server to the internet using ngrok. Run ngrok with the following command:

ngrok http 8000

Finally, add the ngrok URL to your Slack app settings. Now you’re all set!

Customization

You can customize the following options:

  • Channel Summary: Adjust the ChatGPT prompt in topic_analysis.py
  • Thread Summary: Modify the ChatGPT prompt in summarizer.py

Testing

This project utilizes pytest and pytest-cov for testing and measuring coverage. To run the tests:

  1. Navigate to the project root directory.
  2. Run the following command to execute the tests with coverage:
  3. pytest --cov=ossai tests
  4. You’ll see a coverage report that highlights the code lines tested.

Troubleshooting

If you run into issues during setup, consider the following:

  • Ensure you have installed all prerequisites correctly.
  • Double-check your API keys and tokens in the .env file.
  • Make sure your ngrok tunnel is running and the URL is correctly set in Slack.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Future Enhancements

The development of this AI app is ongoing. Upcoming features you can expect include:

  • Integration with LangChain for greater flexibility.
  • Option to summarize messages since a specified date.
  • Support for anonymized message summaries.
  • And much more to enhance functionality!

Conclusion

Congratulations on setting up your open-source Slack AI application! You’ve taken a significant step towards enhancing communication and productivity in your Slack workspace. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox