Code Monkey home page Code Monkey logo

quadlayer's Introduction

Quad Layer

Quad Layer is a Slack bot that integrates LLMs (including from OpenAI, Anthropic, and more thanks to LiteLLM) into Slack. It is written from scratch in Python using Bolt for Python.

Features

  • Recognize voice messages using OpenAI's Whisper API
  • Store messages in Redis for specified amount of time
  • Generate responses using GPT-4 API (both OpenAI and Azure OpenAI is supported)
  • Use in channels, DMs, and threads
    • Quad Layer replies in threads by default, meaning each thread can have its own conversation
  • Use slash commands to interact with Quad Layer and change settings

Installation

We include a Dockerfile for easy deployment. You can also run the bot locally. You will need to create a Slack app and a Redis instance.

Bot Token Scopes

You need to add the following scopes to your bot token:

  • app_mentions:read - to listen for mentions
  • channels:history - to listen for messages within channels
  • im:history - to listen for messages within DMs
  • groups:history - to listen for messages within private channels
  • mpim:history - to listen for messages within group DMs
  • chat:write - to send messages
  • commands - to listen for slash commands

Environment Variables

You will need to set the following environment variables. Please refer to the .env.example file for an example.

  • SLACK_BOT_TOKEN - your bot token (stated as Bot User OAuth Token in your app and starts with xoxb-)
  • SLACK_APP_TOKEN - your app token (stated as App-Level Tokens in your app and starts with xapp-)
  • REDIS_URL - your Redis URL (e.g. redis://localhost:6379)

Usage

Although Quad Layer is designed for deployment within a single Slack workspace, it should be easy to modify it to work with multiple workspaces. (PRs are welcome!)

Deployment

We recommend using Render to deploy Quad Layer due to its simplicity and free tier. You can also deploy it to Heroku or any other platform that supports Docker. You can also run it locally, with or without Docker.

You need to setup a Redis instance to store messages. You can use Render to deploy a Redis instance as well. You can also use a free tier of Redis Labs. You can also run Redis locally.

In addition to these, you will need to have access to GPT-4 API, either through OpenAI or Azure OpenAI.

quadlayer's People

Contributors

gokdt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sycomix 0oeaaeo

quadlayer's Issues

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.