Skip to content

The agent, which lives inside your Telegram, helps you deal with your emails.

Notifications You must be signed in to change notification settings

AndreRab/Email-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✉️ Email-agent ✉️

Python Flask OpenAI Telebot Issues

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.

Application Setup

  1. Clone this repository and navigate to its directory:
git clone https://github.com/AndreRab/Email-agent.git
cd Email-agent
  1. Replace all .env.example files with a simple .env file containing your environment variables:

    • In the agent folder, provide the API key required to invoke any model supported by the OpenAI library.
    • In the gmail_api folder, generate an application key and define the CLIENT_SECRETS_FILE name. (See the next step for instructions on how to obtain it.)
    • In the telegram_bot folder, paste your bot token, which you can obtain from @BotFather.
  2. Create the CLIENT_SECRETS_FILE using 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_FILE variable
  3. If you haven't docker engine download

Application Running

  1. Start your Docker engine.

  2. Build the images:

  docker-compose build --no-cache
  1. Start the containers:
   docker-compose -up

Bot Features

image

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:

image

Follow the instructions at the provided link. Once you complete the login process, you can return to Telegram when you see the following message:

image

To ask the agent to process your prompt, use the /agent_invoke command followed by your input:

image

About

The agent, which lives inside your Telegram, helps you deal with your emails.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published