POC langchain rag discord chatbot. Heavily inspired by DiscordLangAgent
This is a Discord chatbot built with LangChain. It uses the Agent features in LangChain to create flexible conversation chains based on user input. The bot can interact with different language models and tools, and supports multiple API endpoints. It's designed with customization in mind, allowing for the addition and modification of features as needed.
Attempting to test using https://dpytest.readthedocs.io/en/latest/
The .env
file is used to store environment variables for your project. These variables can include API keys, database
URIs, and other sensitive information that you don't want to hardcode into your application.
To set up the .env
file:
sample.env
file to .env
..env
file and replace the placeholder values with your actual values.Here's a breakdown of each item in the .env
file:
DISCORD_BOT_TOKEN
: Your Discord bot token. This is required for your bot to log in to Discord.OOBAENDPOINT
: The endpoint for the Oobabooga API. Follow the setup instructions for the API provided in its
repository. Used for conversation LLM. Leave blank if you want to use KoboldAI api or OpenAI insteadKOBOLDENDPOINT
: The endpoint for the KoboldAI API. Follow the setup instructions for the API provided in its
repository. Used for conversation LLM. Leave blank if you want to use Oobabooga's webui api or OpenAI insteadCHANNEL_ID
: The ID(s) of the text channel(s) you want the bot to watch and reply in. If you want to specify multiple
channels, separate the IDs with a comma (e.g., 1121121529787338903,1121233456307904583).OWNERS
: Your Discord user ID. This is not currently used anywhere.OPENAI
: Your OpenAI API key. This is optional and is currently used only for the DuckDuckGo agent. It's also used
for the conversation LLM if you don't specify KoboldAI or Oobabooga. You can get this from the OpenAI platform.