The Discord AI Bot is a bot service that is integrated with GPT-3.5 and supports custom knowledge for responses.
You can add customized data to the Qdrant database using upsert. When the bot is asked a question, it will search for the most relevant knowledge from Qdrant, and GPT-3.5 will generate a response based on this knowledge.
You will need these dependencies:
Currently, you will need to run a Qdrant database locally. You can check the configuration file (production.yaml) of Qdrant here.
docker pull qdrant/qdrant
docker run -p 6333:6333 -p 6334:6334 \
-e EDRANT__SERVICE_GRPC_PORT="6334" \
-v $(pwd)/data:/qdrant/storage \
-v $(pwd)/production.yaml:/qdrant/config/production.yaml \
qdrant/qdrant
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
export DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN
./discord-ai-bot start COLLECTION_NAME
`COLLECTION_NAME` is the collection name of the qdrant database, where your knowledge store.
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
export DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN
./discord-ai-bot update COLLECTION_NAME DATA_FILE_PATH
COLLECTION_NAME
is the collection name of the qdrant database, where you will upsert knowledge into.
DATA_FILE_PATH
is the JSON file containing your knowledge, and the format of json file should be like:
{
"title": "Title of the Document",
"url": "Related url",
"content": "............."
}
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
export DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN
./discord-ai-bot query COLLECTION_NAME YOUR_QUESTION
COLLECTION_NAME
is the collection name of the qdrant database, which you will upsert knowledge into.
Then it will attempt to utilize the embedding service of OpenAI API and the Qdrant database to provide you with a relevant result.
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
export DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN
./discord-ai-bot query COLLECTION_NAME
This operation will clear all data of COLLECTION_NAME
in the Qdrant database.
MIT © 2023