verba-ex-machina / Mila

Mila: The Mindful, Interactive Lifestyle Assistant
MIT License
2 stars 0 forks source link

Mila

Mila: The Mindful, Interactive Lifestyle Assistant

Overview

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:

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.

Initial Setup

This guide is intended for macOS/Linux users.

Cloning the Repository

Clone the Mila repository into a directory of your choice.

git clone https://github.com/verba-ex-machina/Mila.git
cd Mila

Creating a Virtual Environment

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

Installing Dependencies

Install required dependencies for Mila.

Setting Up API Keys

Obtain and securely store API keys.

  1. Get an OpenAI API key.
  2. Register a Discord bot and get its token.
  3. Add the bot to your server.
  4. Get an OpenWeatherAPI API key (free with a basic account).
  5. Get an ImgFlip account for meme generation.
  6. Get a SerpApi API key for search engine results.

Configuring Environment Variables

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.

Loading Environment Variables

There are two ways to load the variables and virtual environment:

Running the Discord Bot (milabot.py)

With the setup complete and environment variables loaded, run the milabot.py script to activate Mila on Discord.

./milabot.py