repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: '📬 Gmail' |
| #3 | --- |
| #4 | |
| #5 | To use GmailLoader you must install the extra dependencies with `pip install --upgrade embedchain[gmail]`. |
| #6 | |
| #7 | The `source` must be a valid Gmail search query, you can refer `https://support.google.com/mail/answer/7190?hl=en` to build a query. |
| #8 | |
| #9 | To load Gmail messages, you MUST use the data_type as `gmail`. Otherwise the source will be detected as simple `text`. |
| #10 | |
| #11 | To use this you need to save `credentials.json` in the directory from where you will run the loader. Follow these steps to get the credentials |
| #12 | |
| #13 | 1. Go to the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). |
| #14 | 2. Create a project if you don't have one already. |
| #15 | 3. Create an `OAuth Consent Screen` in the project. You may need to select the `external` option. |
| #16 | 4. Make sure the consent screen is published. |
| #17 | 5. Enable the [Gmail API](https://console.cloud.google.com/apis/api/gmail.googleapis.com) |
| #18 | 6. Create credentials from the `Credentials` tab. |
| #19 | 7. Select the type `OAuth Client ID`. |
| #20 | 8. Choose the application type `Web application`. As a name you can choose `embedchain` or any other name as per your use case. |
| #21 | 9. Add an authorized redirect URI for `http://localhost:8080/`. |
| #22 | 10. You can leave everything else at default, finish the creation. |
| #23 | 11. When you are done, a modal opens where you can download the details in `json` format. |
| #24 | 12. Put the `.json` file in your current directory and rename it to `credentials.json` |
| #25 | |
| #26 | ```python |
| #27 | from embedchain import App |
| #28 | |
| #29 | app = App() |
| #30 | |
| #31 | gmail_filter = "to: me label:inbox" |
| #32 | app.add(gmail_filter, data_type="gmail") |
| #33 | app.query("Summarize my email conversations") |
| #34 | ``` |