Giter VIP home page Giter VIP logo

chatgpt-in-slack's Introduction

ChatGPT in Slack

Introducing a transformative app for Slack users, specifically designed to enhance your communication with ChatGPT! With this app, you can seamlessly interact with ChatGPT through Slack channels, streamlining your planning and writing processes with the power of AI.

If you want to see how this app works, you can install the live demo app from https://bit.ly/chat-gpt-in-slack. Please note that this live demo app is being hosted personally by @seratch. If you plan to use this app in your corporate Slack workspace, we highly recommend that you run it on your own infrastructure using the instructions provided below.

How It Works

You can interact with ChatGPT like you do in the website. In the same thread, the bot remember what you already said.

Consider this realistic scenario: ask the bot to generate a business email for communication with your manager.

With ChatGPT, you don't need to ask a perfectly formulated question at first. Adjusting the details after receiving the bot's initial response is a great approach.

Doesn't that sound cool? ๐Ÿ˜Ž

Running the App on Your Local Machine

To run this app on your local machine, you only need to follow these simple steps:

# Create an app-level token with connections:write scope
export SLACK_APP_TOKEN=xapp-1-...
# Install the app into your workspace to grab this token
export SLACK_BOT_TOKEN=xoxb-...
# Visit https://platform.openai.com/account/api-keys for this token
export OPENAI_API_KEY=sk-...

# Optional: gpt-3.5-turbo and gpt-4 are currently supported (default: gpt-3.5-turbo)
export OPENAI_MODEL=gpt-4
# Optional: You can adjust the timeout seconds for OpenAI calls (default: 30)
export OPENAI_TIMEOUT_SECONDS=60
# Optional: You can include priming instructions for ChatGPT to fine tune the bot purpose
export OPENAI_SYSTEM_TEXT="You proofread text. When you receive a message, you will check
for mistakes and make suggestion to improve the language of the given text"

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.py

Running the App for Company Workspaces

Confidentiality of information is top priority for businesses.

This app is open-sourced! so please feel free to fork it and deploy the app onto the infrastructure that you manage. After going through the above local development process, you can deploy the app using Dockerfile, which is placed at the root directory of this project.

The Dockerfile is designed to establish a WebSocket connection with Slack via Socket Mode. This means that there's no need to provide a public URL for communication with Slack.

Contributions

You're always welcome to contribute! ๐Ÿ™Œ When you make changes to the code in this project, please keep these points in mind:

  • When making changes to the app, please avoid anything that could cause breaking behavior. If such changes are absolutely necessary due to critical reasons, like security issues, please start a discussion in GitHub Issues before making significant alterations.
  • When you have the chance, please write some unit tests. Especially when you touch internals.py and add/edit the code that do not call any web APIs, writing tests should be relatively easy.
  • Before committing your changes, be sure to run ./validate.sh. The script runs black (code formatter), flake8 and pytype (static code analyzers).

The License

The MIT License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.