No project description provided
Project description
The Open-Source Slack AI App
This repository is a ready-to-run basic Slack AI solution you can host yourself and unlock the ability to summarize threads and channels on demand using OpenAI (support for alternative and open source LLMs will be added if there's demand). The official Slack AI product looks great, but with limited access and add-on pricing, I decided to open-source the version I built in September 2023. Learn more about how and why I built an open-source Slack AI.
Once up and running (instructions for the whole process are provided below), all your Slack users will be able to generate to both public and private:
- Thread summaries - Generate a detailed summary of any Slack thread (powered by GPT-3.5-Turbo)
- Channel overviews - Generate an outline of the channel's purpose based on the extended message history (powered by an ensemble of NLP models and a little GPT-4 to explain the analysis in natural language)
- Channel summaries (beta) - Generate a detailed summary of a channel's extended history (powered by GPT-3.5-Turbo). Note: this can get very long!
Table of Contents
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
Ensure you have the following preconfigured or installed on your local development machine:
- Python 3.8 or higher
- OpenAI API key
- Slack App & associated API tokens
- Poetry package manager
- ngrok (recommended)
Installation
- Clone the repository to your local machine.
- Navigate to the project directory.
- Install the required Python packages using Poetry:
poetry install
- Install the dictionary model
poetry run python -m spacy download en_core_web_md
- Create a
.env
file in the root directory of the project, and fill it with your API keys and tokens. Use theexample.env
file as a template.
cp example.env .env && open .env
Slack app configuration
TODO
Usage
To run the application, run the FastAPI server:
cd ossai && poetry run uvicorn slack_server:fast_app --reload
You'll then need to expose the server to the internet using ngrok.
Run ngrok with the following command: ngrok http 8000
Then add the ngrok URL to your Slack app's settings.
Customization
The main customization options are:
- Channel Summary: customize the ChatGPT prompt in
topic_analysis.py
- Thread Summary: customize the ChatGPT prompt in
summarizer.py
Testing
This project uses pytest
and pytest-cov
to run tests and measure test coverage.
Follow these steps to run the tests with coverage:
-
Navigate to the project root directory.
-
Run the following command to execute the tests with coverage:
pytest --cov=ossai tests/
This command will run all the tests in the
tests/
directory and generate a coverage report for theossai
module. -
After running the tests, you will see a report in your terminal that shows the percentage of code covered by tests and highlights any lines that are not covered.
Please note that if you're using a virtual environment, make sure it's activated before running these commands.
Future Enhancements
- Move to LangChain & LangSmith for extensibility, tracing, & control
- Implement evals suite to complement unit tests
- Add support for alternative and open-source LLMs
- Explore workflow for collecting data & fine-tuning models for cost reduction
- Add support for anonymized message summaries
- Leverage prompt tools like Chain of Destiny
- Add support for pulling supporting context from external sources like company knowledge bases
- Explore caching and other performance optimizations
- Explore sentiment analysis
Contributing
I more than welcome contributions! Please read CONTRIBUTING.md
for details on how to submit feedback, bugs, feature
requests,
enhancements, or your own pull requests.
License
This project is licensed under the GPL-3.0 License - see the LICENSE.md
file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for open_source_slack_ai-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c2e8c82ce6a5c51d58c0e214ed12861603b77c0b020ab3f4f2757006b88121 |
|
MD5 | de96b5c6b361b92ccb41815e1cedd8b3 |
|
BLAKE2b-256 | fd18a850d5f55f6a20fbae4ef28fe1f0a2d62b161ec1b76a77190366b7b35344 |
Hashes for open_source_slack_ai-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 828bc69b18bfde2ff2873a0b8c2e22658e77f3f502471a91c919a8beb683dc37 |
|
MD5 | fa06171a1826e4397148f71619bb2078 |
|
BLAKE2b-256 | 59b24368b525488505b7f348048856c316c614b68623bbdece285b5f77fe4227 |