The GMAIL_CREDENTIALS_FILE refers to the OAuth 2.0 Client ID JSON file that allows this application to access your Gmail account securely.
- Go to the Google Cloud Console.
- Click the project dropdown (top left) and select New Project.
- Name it (e.g., "RAG Support Bot") and click Create.
- In the sidebar, go to APIs & Services > Library.
- Search for "Gmail API".
- Click on it and click Enable.
- Go to APIs & Services > OAuth consent screen.
- Select External (unless you have a Google Workspace organization, then Internal is fine). Click Create.
- App Information: Fill in App Name (e.g., "Support Bot") and User Support Email.
- Developer Contact: Add your email.
- Click Save and Continue.
- Scopes: Click Add or Remove Scopes. Search for
gmail.modifyand select it. Click Update, then Save and Continue. - Test Users: Click Add Users and add the Gmail address you want to use for sending emails. This is crucial.
- Click Save and Continue.
- Go to APIs & Services > Credentials.
- Click + CREATE CREDENTIALS > OAuth client ID.
- Application type: Select Desktop app.
- Name it (e.g., "Python Client").
- Click Create.
- You will see a pop-up "OAuth client created".
- Click the Download JSON button (icon with a down arrow).
- Save this file to your project folder:
/Users/nayaneshgupte/AI Projects/RAG Demo/. - Rename the file to
credentials.json.
Your project folder should now contain:
main.py.envcredentials.json<--- The file you just downloaded.