This project provides a GPT-4 email assistant that responds to emails and fulfills various tasks for the user. The assistant has access to numerous commands, resources, and can interact with Google Calendar API. To set up the project, follow the instructions below.
GPT-4.Email.Assistant.mp4
Python 3.8 or higher
- Install the required packages using requirements.txt:
pip install -r requirements.txt
-
Follow the instructions at Google Calendar Simple API Getting Started to set up the Google Calendar API credentials. Copy the credentials to
~/.credentials
-
Set up an email account for your bot which you will use to email to and the bot will monitor. I used Gmail and got an app password.
-
Set up a serper.dev account to provide Search.
To set up environment variables for the project, rename the sample_env
file to .env
and fill in the necessary information. Here's a description of each variable:
OPENAI_API_KEY
: Your OpenAI API key for the GPT-4 model.SERPER_API_KEY
: Your serper.dev API key for search functionality.EMAIL_USER
: The email address of your bot.EMAIL_PASSWORD
: The API key or password for your bot's email account.EXPECTED_SENDERS
: A comma-separated list of email addresses that are allowed to send commands to the bot.CALENDAR_USER
: The google calendar user.CALENDAR_TOKEN_PICKLE
: File location of token pickle from Google Calendar install above.
Example:
OPENAI_API_KEY=your_openai_key
SERPER_API_KEY=your_serper_key
SCRAPINGANT_API_KEY=your_scrapingant_key (optional)
EMAIL_USER=your_bot_email@example.com
EMAIL_PASSWORD=your_bot_email_password
EXPECTED_SENDERS=user1@example.com,user2@example.com
CALENDAR_USER=user@gmail.com
CALENDAR_TOKEN_PATH=/home/user/.credentials/token.pickle
Run the email assistant which runs in a loop - I just ran mine in screen
and detach it:
python code/main.py
To test on console run with --testconsole
argument:
python code/main.py --testconsole