Email-agent is an agent that helps you navigate through your emails using the Telegram Bot API. You can ask for unread messages, mark them as read, and see a short message overview for each user. Additionally, you can request specific help from the agent when you need to find something in your emails quickly.
- Clone this repository and navigate to its directory:
git clone https://github.com/AndreRab/Email-agent.git
cd Email-agent-
Replace all
.env.examplefiles with a simple.envfile containing your environment variables:- In the
agentfolder, provide the API key required to invoke any model supported by the OpenAI library. - In the
gmail_apifolder, generate an application key and define theCLIENT_SECRETS_FILEname. (See the next step for instructions on how to obtain it.) - In the
telegram_botfolder, paste your bot token, which you can obtain from @BotFather.
- In the
-
Create the
CLIENT_SECRETS_FILEusing the Google Cloud Console:- Open the Google Cloud Console
- Create a new project
- Navigate to APIs & Services > Credentials
- Click Create Credentials and select OAuth client ID
- Choose Web application as the application type
- Add the following to Authorized redirect URIs:
http://localhost:1000/oauth/callback - Download the credentials file
- Move the file to the gmail_api folder
- Set the correct filename in your .env file under the
CLIENT_SECRETS_FILEvariable
-
If you haven't docker engine download
-
Start your Docker engine.
-
Build the images:
docker-compose build --no-cache- Start the containers:
docker-compose -up
The bot provides 6 features. To use any of them, you need to log in first. The bot will prompt you to follow a login link:
Follow the instructions at the provided link. Once you complete the login process, you can return to Telegram when you see the following message:
To ask the agent to process your prompt, use the /agent_invoke command followed by your input: