Discord bot that uses the OpenAI embeddings and chat completion APIs to answer queries using the CCNet wiki.
User input is filtered using the OpenAI moderation API, which is free.
This bot requires three files:
openai_api_key.txt
: contains the OpenAI API keytoken.txt
: contains the bot tokenwiki_embeddings.csv
: embeddings generated from the CCNet Wiki.
There are three commands:
$reload <file name>
- reloads the cog in the given file$update_embeddings
- regenerateswiki_embeddings.csv
using a wiki.js local file system dump. This must be located in a "wiki" subdirectory in the project root./askwiki <query>
Updating the wiki involves updating the wiki
subdirectory with a fresh wiki dump and running $update_embeddings
.
requirements.txt
is updated using pipreqs
.