Code Monkey home page Code Monkey logo

slackgpt's Introduction

Go Slack-Bot with OpenAI Assistants API

This is a Slack Bot written in Go. It integrates OpenAI’s latest Assistants API into Slack to respond to messages. The app acts as a web server that listens for incoming messages from Slack, sends these messages to OpenAI’s API, and subsequently sends the AI-generated responses back to Slack.

It uses the new Assistants API from OpenAI with the ability to upload files like PDFs, allowing you to ask questions about the content of the file.

Purposefully, OpenAI and Slack libs were foregone to create a more lightweight application.

Please note that you need to have a Slack account and a workspace to use this app. You also need to have an OpenAI account and an API key. Please edit the .env file with your Slack and OpenAI credentials.

slackgpt's People

Stargazers

 avatar

Watchers

 avatar

slackgpt's Issues

Move slacksignature Middleware to pkg for Reusability

Summary

The slacksignature middleware, which is currently located in the internal directory, has proven to be valuable and potentially reusable in other projects. To foster code reuse and follow best practices, we propose moving this middleware to the pkg directory.

Goal

The main goal of this task is to make slacksignature, a Fiber middleware for validating incoming Slack requests, easily accessible and reusable across multiple projects without duplicating code or altering its implementation for each new project.

Tasks

  • Review the current implementation of the slacksignature middleware for any project-specific dependencies that might affect reusability.
  • Move the slacksignature middleware from the internal directory to the pkg directory.
  • Update any internal project references to the slacksignature middleware to reflect its new location in the pkg directory.
  • Ensure that all tests pass after the migration to detect any potential issues early.
  • Update the project's README and documentation, highlighting the availability of slacksignature middleware for use in other projects and providing basic usage instructions.

Potential Challenges

  • Ensuring the slacksignature middleware does not have any project-specific dependencies that could hinder its reusability.
  • Updating all internal references without missing any that could lead to build or runtime errors.

Benefits

  • Promotes code reuse across projects, reducing the need to reinvent the wheel for each new project that requires Slack request validation.
  • Aligns with the Go community's best practices regarding shared library management.
  • Enhances the visibility and potential contributions to slacksignature middleware, improving its quality and adaptability over time.

Conclusion

Migrating the slacksignature middleware to the pkg directory aligns with our goals of promoting code reusability and adhering to best practices. This move will not only benefit our current projects but also the wider Go community by making a useful resource readily available.

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.