ChatGPTSlackBot  by pedrorito

Slack bot for ChatGPT integration

created 2 years ago
385 stars

Top 75.6% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Slack bot that integrates with OpenAI's ChatGPT, enabling users to interact with the AI directly within Slack channels. It's designed for Slack users and developers who want to leverage ChatGPT's capabilities for answering questions, generating text, or automating tasks within their Slack workspaces.

How It Works

The bot utilizes the revChatGPT Python package to handle authentication and communication with the OpenAI API. It listens for app_mention events via the Slack Events API. Upon receiving a mention, it extracts the user's message, sends it to revChatGPT for processing by a GPT-3 model, and then posts the generated response back to the Slack channel. Session management for the API is handled in a separate thread to prevent expiration.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Set environment variables: SLACK_SIGNING_SECRET, SLACK_BOT_TOKEN, OPENAI_API_KEY.
  • Run the bot: python app.py
  • Alternatively, use Docker: docker-compose up -d after configuring variables.env.
  • Requires Python 3.x.
  • OpenAI API key required.
  • Slack App configuration with app_mentions:read, chat:write, im:write scopes (and im:history, message:im for direct messages).
  • Subscribe to app_mention events in Slack Event Subscriptions.

Highlighted Details

  • Leverages revChatGPT for OpenAI API interaction.
  • Supports direct messages and channel mentions.
  • Configurable API token and conversation IDs.
  • Exposes port 4000 by default for Slack events.

Maintenance & Community

  • This is a personal project, not affiliated with OpenAI or Slack.
  • No specific community links (Discord/Slack) or roadmap are provided in the README.

Licensing & Compatibility

  • Licensed under GPL 2.0.
  • GPL 2.0 license may have implications for commercial use or linking with closed-source software due to its copyleft nature.

Limitations & Caveats

The bot relies on a pre-trained GPT-3 model, limiting its knowledge to the data it was trained on. The tls-client library used by revChatGPT does not currently support ARM architectures, preventing operation on ARM-based devices.

Health Check
Last commit

2 years ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.