Mila is a Discord bot designed to interactively assist with lifestyle management using OpenAI's technologies.
"Lifestyle Management" is a broad term that encompasses a variety of activities. What's your lifestyle? Customize Mila to fit your needs.
At the moment, Mila can:
- Search the 'net with DuckDuckGo.
- Retrieve and parse websites.
- Get live weather forecasts via OpenWeatherMap.
- Generate memes via ImgFlip.
- Check your horoscope.
- And more!
Mila can be expanded with additional functionality by adding new tools to mila/tools/
and registering them in mila/tools/__init__.py
.
REMEMBER: Mila is an experiment. A fun pet project. It is not intended for production use. It connects to your OpenAI key, which is connected to your wallet. Use at your own risk.
This guide is intended for macOS/Linux users.
Clone the Mila repository into a directory of your choice.
git clone https://github.com/verba-ex-machina/Mila.git
cd Mila
Set up a Python virtual environment in the cloned directory.
python3 -m venv venv
Activate the virtual environment.
source venv/bin/activate
Verify Python path (should be within venv
directory).
which python3
Install required dependencies for Mila.
- For general use:
pip install -r requirements.txt
- For development:
pip install -r requirements.txt -r requirements-dev.txt
Obtain and securely store API keys.
- Get an OpenAI API key.
- Register a Discord bot and get its token.
- Add the bot to your server.
- Get an OpenWeatherAPI API key (free with a basic account).
- Get an ImgFlip account for meme generation.
- Get a SerpApi API key for search engine results.
Create an .envrc
file in the root directory with the following content, replacing placeholders with actual API keys.
export DISCORD_TOKEN="your_discord_token"
export IMGFLIP_USERNAME="your_imgflip_username"
export IMGFLIP_PASSWORD="your_imgflip_password"
export OPENAI_API_KEY="your_openai_api_key"
export OPENWEATHERMAP_API_KEY="your_openweathermap_api_key"
export SERPAPI_API_KEY="your_serpapi_api_key"
layout python3
Important: Do not commit the .envrc
file to the repository or share it.
There are two ways to load the variables and virtual environment:
- Manually:
source .envrc
- Automatically using
direnv
(installation guide).
With the setup complete and environment variables loaded, run the milabot.py
script to activate Mila on Discord.
./milabot.py