GithubHelp home page GithubHelp logo

aidiscordbot's Introduction

How to run this bot?

  1. Run pip install requirements.txt
  2. Get your OpenAI API key
  3. Get your Discord bot's token
  4. Run a Qdrant database
  5. See the example.env files for the environment variables you have to set. Or, instead, create a copy of it named .envin the same directory, with the variables set
  6. Run python main.py

The bot does not require "read message" intents, and will only read messages if pinged.

How to add knowledge?

Create a folder named "knowledge" and add some .txt files in it. The text files must contain either paragraphs or chunks somewhere in the text, and that decides how they will be indexed by AI:

  • paragraphs will split chunks of knowledge whenever it finds a double-newline
  • chunkswill split chunks of knowledge in pieces of approximately ~24k character

That means that the AI will include whole pieces of knowledge it deems relevant on its prompt

Caution

The whole knowledge database is re-indexed every time the bot restarts (knowledge.py). This is a known issue, and will cost you some money, even though creating text embeddings is very cheap

Also, this code is in general very unfinished. Expect bugs.

Costs

Experimental data suggests the cost is around ~$2/1000 messages exchanged with the bot (pessimistic estimate).

Indexing knowledge (happens just once on startup) costs around $0.04 per megabyte of text.

aidiscordbot's People

Contributors

oskarzyg avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  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.