Code Monkey home page Code Monkey logo

aibot's Introduction

Dall-E generated image of a logo with books inside a brain, and the text 'AbbyLarby'

AbbyLarby is a Slack bot for connecting to generative AI helpers.

Features

/ai slash command

Available commands:

  • /ai <prompt>: Show the OpenAI text API's response to <prompt>. Visible only to you.
  • /ai img <prompt>: Show the Dall-E image generated by <prompt>. Visible only to you.
  • /ai say <prompt> or * /ai say img <prompt>: immediately post the result to the channel.

Conversation bot

Have a longer conversation by talking directly with the bot in the app Messages tab.

The bot can also be added to any channel, and then will respond to @ mentions.

Configuration

Configuration is via the environment variables set in .env.example. You can copy the file to .env or set environment variables another way.

  • MODEL: a model using the OpenAI chat API, e.g. "gpt-4" or "gpt-3.5-turbo".
  • MODEL_MAX_TOKENS: the maximum number of tokens allowed by the given model. For cost, it may be useful to set this lower than the actual max, as a long conversation or a question in a long public channel can generate a lot of context.
  • HIDDEN_PROMPT_URL: A url containing text to provide as the system prompt to the bot. All paragraph tags, whose text does not start with #, will be included as paragraphs at the start of the hidden prompt. The URL will be refetched once every five minutes. A Google Doc that is published to the web works well as a hidden prompt URL.

Dev setup

(lazy requirements for now)

pip install requirements.txt

Copy .env.example to .env and write credentials.

Run dev server:

watchmedo auto-restart python aibot.py

This uses sockets to talk to Slack, so dev bot will be live if you're using live credentials.

Server hosting

Just keep python aibot.py running on the server. See Procfile for running with Dokku.

aibot's People

Contributors

jcushman avatar bensteinberg avatar

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.