Giter Site home page Giter Site logo

maazso / gmail-assist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sam1am/gmail-assist

0.0 0.0 0.0 33 KB

Get control of your overflowing inbox using GPT-3 to classify your emails by importance.

Home Page: http://merrythieves.com

Python 100.00%

gmail-assist's Introduction

Gmail Importance Classifier using GPT-3

Note: this is a proof on concept and may not work as expected. Use at your own risk.

This script uses OpenAI's GPT-3 to classify the importance of unread emails in Gmail and labels them accordingly. The labels used are:

  • gptJunk
  • gptLow
  • gptNormal
  • gptImportant
  • gptUrgent

Prerequisites

To run this script, you need:

  • Python 3
  • A Google Cloud Platform project with the Gmail API enabled
  • Credentials for the Gmail API
  • An OpenAI API key
  • ==Add the labels listed above to your gmail account before running the script==

Installation

  1. Clone this repository
  2. Install the required Python packages by running pip install -r requirements.txt
  3. Set up the Google Cloud Platform project and the Gmail API credentials by following the instructions here and saving the credentials file as credentials.json in the project directory
  4. Obtain an OpenAI API key by following the instructions here
  5. Save the OpenAI API key to a text file named openaikey.txt in the project directory

Usage

  1. (optional) Customize the prompt.txt file as desired.
  2. (optional) Modify the model used in openai_api.py (line 25) - text-davinci-0003 by default.
  3. Run the script by running python gmail_assist.py
  4. The script will connect to the Gmail API and find unread emails not already labeled by the script. They will be labeled based on their importance.

What you do with them from there is up to you. The emails will not be modified in any other way. The tags can be used for bulk processing or creating other rules.

To process another account, delete the token.pickle file that was created when you first authenticated and run the script again.

What's Next

This started as a Thunderbird plugin which had the benefit of running on every new email that comes in. I may try to implement that.

I will accept pull requests from anyone who wants to help build this out more.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • OpenAI for providing the GPT-3 API
  • Google for providing the Gmail API

gmail-assist's People

Contributors

sam1am avatar bphd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.