/Email-With-GPT

Creating a custom GPT to send Emails using the MailJet API

Primary LanguagePython

Email With GPT

This repository contains the files used to create this custom GPT which allows users to send emails to recipient emails with the subject and content generated by the GPT model.

Visit the web-app here↗

Features

  • Chatbot-like interface using Streamlit
  • Uses the Function-calling feature of OpenAI's GPT-3.5 Turbo model
  • Uses the MailJet API to enable email delivery
  • Hosted on Streamlit Community Cloud

Run Locally

Clone the project

  git clone https://github.com/lilNewbie/Email-With-GPT.git

Go to the project directory

  cd Email-With-GPT

Install dependencies

  pip install -r requirements.txt

Update the following API Keys in the secrets.toml file present in the .streamlit folder.

OPENAI_API_KEY MAILJET_API_KEY MAILJET_API_SECRET

Comment the required lines and uncomment the required lines in the func.py file

#YOU CAN COMMENT THESE THREE LINES WHEN RUNNING LOCALLY AND CAN MAKE USE OF THE secrets.toml FILE TO ADD YOUR API KEYS
#mailjet_api_key = st.sidebar.text_input("Enter MailJet API's public key", '', type='password')
#mailjet_api_secret = st.sidebar.text_input("Enter MailJet API's private key", '', type='password')
#openai_secret_key = st.sidebar.text_input("Enter OpenAI's API key", '', type='password')

#UNCOMMENT THESE LINES WHEN USING THE secret.toml FILE TO ACCESS YOUR API KEYS
mailjet_api_key = st.secrets['MAILJET_API_KEY']
mailjet_api_secret = st.secrets['MAILJET_API_SECRET']
openai_secret_key = st.secrets['OPENAI_API_KEY']

Run the web-app

  streamlit run func.py

Demo

Using the web-app

Add the required API keys Screenshot (1820) - copy

Type in the prompt and wait for the response Screenshot (1819) - copy

Check email and voila! Screenshot (1821) - copy