airbyte-agent-gmail 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airbyte_agent_gmail-0.1.0/.gitignore +34 -0
- airbyte_agent_gmail-0.1.0/AUTH.md +179 -0
- airbyte_agent_gmail-0.1.0/CHANGELOG.md +6 -0
- airbyte_agent_gmail-0.1.0/PKG-INFO +170 -0
- airbyte_agent_gmail-0.1.0/README.md +137 -0
- airbyte_agent_gmail-0.1.0/REFERENCE.md +1114 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/__init__.py +139 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/__init__.py +1 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/__init__.py +83 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/auth_strategies.py +1171 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/auth_template.py +135 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/cloud_utils/__init__.py +5 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/cloud_utils/client.py +374 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/connector_model_loader.py +1116 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/constants.py +78 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/exceptions.py +23 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/executor/__init__.py +31 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/executor/hosted_executor.py +230 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/executor/local_executor.py +1842 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/executor/models.py +202 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/extensions.py +693 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/__init__.py +37 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/adapters/__init__.py +9 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/adapters/httpx_adapter.py +260 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/config.py +98 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/exceptions.py +119 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/protocols.py +114 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http/response.py +104 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/http_client.py +693 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/introspection.py +493 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/logging/__init__.py +11 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/logging/logger.py +273 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/logging/types.py +93 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/observability/__init__.py +11 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/observability/config.py +179 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/observability/models.py +19 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/observability/redactor.py +81 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/observability/session.py +103 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/performance/__init__.py +6 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/performance/instrumentation.py +57 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/performance/metrics.py +93 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/__init__.py +73 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/base.py +246 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/components.py +244 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/connector.py +120 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/extensions.py +339 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/operations.py +157 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/schema/security.py +266 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/secrets.py +182 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/telemetry/__init__.py +10 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/telemetry/config.py +32 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/telemetry/events.py +59 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/telemetry/tracker.py +155 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/types.py +328 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/utils.py +127 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/validation/__init__.py +22 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/validation/models.py +17 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/validation/readiness.py +995 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/_vendored/connector_sdk/validation/replication.py +1344 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/connector.py +1524 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/connector_model.py +2220 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/models.py +340 -0
- airbyte_agent_gmail-0.1.0/airbyte_agent_gmail/types.py +148 -0
- airbyte_agent_gmail-0.1.0/pyproject.toml +50 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
.eggs/
|
|
9
|
+
|
|
10
|
+
# Testing
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
htmlcov/
|
|
14
|
+
|
|
15
|
+
# Virtual environments
|
|
16
|
+
.venv/
|
|
17
|
+
venv/
|
|
18
|
+
|
|
19
|
+
# IDE
|
|
20
|
+
.idea/
|
|
21
|
+
.vscode/
|
|
22
|
+
*.swp
|
|
23
|
+
|
|
24
|
+
# OS
|
|
25
|
+
.DS_Store
|
|
26
|
+
Thumbs.db
|
|
27
|
+
|
|
28
|
+
.env
|
|
29
|
+
configured_connectors.yaml
|
|
30
|
+
|
|
31
|
+
# Claude Code development symlink
|
|
32
|
+
# Contributors: Create this symlink locally for skill testing
|
|
33
|
+
# mkdir -p .claude/skills && ln -s ../../skills/airbyte-agent-connectors .claude/skills/airbyte-agent-connectors
|
|
34
|
+
.claude/skills/airbyte-agent-connectors
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Gmail authentication
|
|
2
|
+
|
|
3
|
+
This page documents the authentication and configuration options for the Gmail agent connector.
|
|
4
|
+
|
|
5
|
+
## Authentication
|
|
6
|
+
|
|
7
|
+
### Open source execution
|
|
8
|
+
|
|
9
|
+
In open source mode, you provide API credentials directly to the connector.
|
|
10
|
+
|
|
11
|
+
#### OAuth
|
|
12
|
+
|
|
13
|
+
`credentials` fields you need:
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
| Field Name | Type | Required | Description |
|
|
17
|
+
|------------|------|----------|-------------|
|
|
18
|
+
| `access_token` | `str` | No | Your Google OAuth2 Access Token (optional, will be obtained via refresh) |
|
|
19
|
+
| `refresh_token` | `str` | Yes | Your Google OAuth2 Refresh Token |
|
|
20
|
+
| `client_id` | `str` | No | Your Google OAuth2 Client ID |
|
|
21
|
+
| `client_secret` | `str` | No | Your Google OAuth2 Client Secret |
|
|
22
|
+
|
|
23
|
+
Example request:
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from airbyte_agent_gmail import GmailConnector
|
|
27
|
+
from airbyte_agent_gmail.models import GmailAuthConfig
|
|
28
|
+
|
|
29
|
+
connector = GmailConnector(
|
|
30
|
+
auth_config=GmailAuthConfig(
|
|
31
|
+
access_token="<Your Google OAuth2 Access Token (optional, will be obtained via refresh)>",
|
|
32
|
+
refresh_token="<Your Google OAuth2 Refresh Token>",
|
|
33
|
+
client_id="<Your Google OAuth2 Client ID>",
|
|
34
|
+
client_secret="<Your Google OAuth2 Client Secret>"
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Token
|
|
40
|
+
This authentication method isn't available for this connector.
|
|
41
|
+
|
|
42
|
+
### Hosted execution
|
|
43
|
+
|
|
44
|
+
In hosted mode, you first create a connector via the Airbyte API (providing your OAuth or Token credentials), then execute operations using either the Python SDK or API. If you need a step-by-step guide, see the [hosted execution tutorial](https://docs.airbyte.com/ai-agents/quickstarts/tutorial-hosted).
|
|
45
|
+
|
|
46
|
+
#### OAuth
|
|
47
|
+
Create a connector with OAuth credentials.
|
|
48
|
+
|
|
49
|
+
`credentials` fields you need:
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
| Field Name | Type | Required | Description |
|
|
53
|
+
|------------|------|----------|-------------|
|
|
54
|
+
| `access_token` | `str` | No | Your Google OAuth2 Access Token (optional, will be obtained via refresh) |
|
|
55
|
+
| `refresh_token` | `str` | Yes | Your Google OAuth2 Refresh Token |
|
|
56
|
+
| `client_id` | `str` | No | Your Google OAuth2 Client ID |
|
|
57
|
+
| `client_secret` | `str` | No | Your Google OAuth2 Client Secret |
|
|
58
|
+
|
|
59
|
+
`replication_config` fields you need:
|
|
60
|
+
|
|
61
|
+
| Field Name | Type | Required | Description |
|
|
62
|
+
|------------|------|----------|-------------|
|
|
63
|
+
| `include_spam_and_trash` | `bool` | No | Include messages from SPAM and TRASH in the results. Defaults to false. |
|
|
64
|
+
|
|
65
|
+
Example request:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
curl -X POST "https://api.airbyte.ai/api/v1/integrations/connectors" \
|
|
69
|
+
-H "Authorization: Bearer <YOUR_BEARER_TOKEN>" \
|
|
70
|
+
-H "Content-Type: application/json" \
|
|
71
|
+
-d '{
|
|
72
|
+
"external_user_id": "<EXTERNAL_USER_ID>",
|
|
73
|
+
"connector_type": "Gmail",
|
|
74
|
+
"name": "My Gmail Connector",
|
|
75
|
+
"credentials": {
|
|
76
|
+
"access_token": "<Your Google OAuth2 Access Token (optional, will be obtained via refresh)>",
|
|
77
|
+
"refresh_token": "<Your Google OAuth2 Refresh Token>",
|
|
78
|
+
"client_id": "<Your Google OAuth2 Client ID>",
|
|
79
|
+
"client_secret": "<Your Google OAuth2 Client Secret>"
|
|
80
|
+
},
|
|
81
|
+
"replication_config": {
|
|
82
|
+
"include_spam_and_trash": "<Include messages from SPAM and TRASH in the results. Defaults to false.>"
|
|
83
|
+
}
|
|
84
|
+
}'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
#### Bring your own OAuth flow
|
|
90
|
+
To implement your own OAuth flow, use Airbyte's server-side OAuth API endpoints. For a complete guide, see [Implement your own OAuth flow](https://docs.airbyte.com/ai-agents/quickstarts/tutorial-server-side-oauth).
|
|
91
|
+
|
|
92
|
+
**Step 1: Initiate the OAuth flow**
|
|
93
|
+
|
|
94
|
+
Request a consent URL for your user.
|
|
95
|
+
|
|
96
|
+
| Field Name | Type | Required | Description |
|
|
97
|
+
|------------|------|----------|-------------|
|
|
98
|
+
| `external_user_id` | `string` | Yes | Your unique identifier for the end user |
|
|
99
|
+
| `connector_type` | `string` | Yes | The connector type (e.g., "Gmail") |
|
|
100
|
+
| `redirect_url` | `string` | Yes | URL to redirect to after OAuth authorization |
|
|
101
|
+
|
|
102
|
+
Example request:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
curl -X POST "https://api.airbyte.ai/api/v1/integrations/connectors/oauth/initiate" \
|
|
106
|
+
-H "Authorization: Bearer <YOUR_BEARER_TOKEN>" \
|
|
107
|
+
-H "Content-Type: application/json" \
|
|
108
|
+
-d '{
|
|
109
|
+
"external_user_id": "<EXTERNAL_USER_ID>",
|
|
110
|
+
"connector_type": "Gmail",
|
|
111
|
+
"redirect_url": "https://yourapp.com/oauth/callback"
|
|
112
|
+
}'
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Redirect your user to the `consent_url` from the response. After they authorize, they'll be redirected back to your app with a `secret_id` query parameter.
|
|
116
|
+
|
|
117
|
+
**Step 2: Create a connector with the secret ID**
|
|
118
|
+
|
|
119
|
+
| Field Name | Type | Required | Description |
|
|
120
|
+
|------------|------|----------|-------------|
|
|
121
|
+
| `external_user_id` | `string` | Yes | Your unique identifier for the end user |
|
|
122
|
+
| `connector_type` | `string` | Yes | The connector type (e.g., "Gmail") |
|
|
123
|
+
| `name` | `string` | Yes | A name for this connector instance |
|
|
124
|
+
| `server_side_oauth_secret_id` | `string` | Yes | The secret_id from the OAuth callback |
|
|
125
|
+
| `replication_config.include_spam_and_trash` | `bool` | No | Include messages from SPAM and TRASH in the results. Defaults to false. |
|
|
126
|
+
|
|
127
|
+
Example request:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
curl -X POST "https://api.airbyte.ai/api/v1/integrations/connectors" \
|
|
131
|
+
-H "Authorization: Bearer <YOUR_BEARER_TOKEN>" \
|
|
132
|
+
-H "Content-Type: application/json" \
|
|
133
|
+
-d '{
|
|
134
|
+
"external_user_id": "<EXTERNAL_USER_ID>",
|
|
135
|
+
"connector_type": "Gmail",
|
|
136
|
+
"name": "My Gmail Connector",
|
|
137
|
+
"server_side_oauth_secret_id": "<secret_id_from_callback>",
|
|
138
|
+
"replication_config": {
|
|
139
|
+
"include_spam_and_trash": "<Include messages from SPAM and TRASH in the results. Defaults to false.>"
|
|
140
|
+
}
|
|
141
|
+
}'
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Token
|
|
145
|
+
This authentication method isn't available for this connector.
|
|
146
|
+
|
|
147
|
+
#### Execution
|
|
148
|
+
|
|
149
|
+
After creating the connector, execute operations using either the Python SDK or API.
|
|
150
|
+
|
|
151
|
+
**Python SDK**
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from airbyte_agent_gmail import GmailConnector, AirbyteAuthConfig
|
|
155
|
+
|
|
156
|
+
connector = GmailConnector(
|
|
157
|
+
auth_config=AirbyteAuthConfig(
|
|
158
|
+
external_user_id="<your_external_user_id>",
|
|
159
|
+
airbyte_client_id="<your-client-id>",
|
|
160
|
+
airbyte_client_secret="<your-client-secret>"
|
|
161
|
+
)
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
@agent.tool_plain # assumes you're using Pydantic AI
|
|
165
|
+
@GmailConnector.tool_utils
|
|
166
|
+
async def gmail_execute(entity: str, action: str, params: dict | None = None):
|
|
167
|
+
return await connector.execute(entity, action, params or {})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**API**
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
curl -X POST 'https://api.airbyte.ai/api/v1/integrations/connectors/<connector_id>/execute' \
|
|
174
|
+
-H 'Authorization: Bearer <YOUR_BEARER_TOKEN>' \
|
|
175
|
+
-H 'Content-Type: application/json' \
|
|
176
|
+
-d '{"entity": "<entity>", "action": "<action>", "params": {}}'
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: airbyte-agent-gmail
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Airbyte Gmail Connector for AI platforms
|
|
5
|
+
Project-URL: Homepage, https://github.com/airbytehq/airbyte-agent-connectors
|
|
6
|
+
Project-URL: Documentation, https://docs.airbyte.com/ai-agents/
|
|
7
|
+
Project-URL: Repository, https://github.com/airbytehq/airbyte-agent-connectors
|
|
8
|
+
Project-URL: Issues, https://github.com/airbytehq/airbyte-agent-connectors/issues
|
|
9
|
+
Author-email: Airbyte <contact@airbyte.io>
|
|
10
|
+
License: Elastic-2.0
|
|
11
|
+
Keywords: agent,ai,airbyte,api,connector,data-integration,gmail,llm,mcp
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: Other/Proprietary License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.13
|
|
22
|
+
Requires-Dist: httpx>=0.24.0
|
|
23
|
+
Requires-Dist: jinja2>=3.0.0
|
|
24
|
+
Requires-Dist: jsonpath-ng>=1.6.1
|
|
25
|
+
Requires-Dist: jsonref>=1.1.0
|
|
26
|
+
Requires-Dist: opentelemetry-api>=1.37.0
|
|
27
|
+
Requires-Dist: opentelemetry-sdk>=1.37.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
30
|
+
Requires-Dist: pyyaml>=6.0
|
|
31
|
+
Requires-Dist: segment-analytics-python>=2.2.0
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Gmail
|
|
35
|
+
|
|
36
|
+
The Gmail agent connector is a Python package that equips AI agents to interact with Gmail through strongly typed, well-documented tools. It's ready to use directly in your Python app, in an agent framework, or exposed through an MCP.
|
|
37
|
+
|
|
38
|
+
Gmail is Google's email service that provides email sending, receiving, and organization
|
|
39
|
+
capabilities. This connector provides access to messages, threads, labels, drafts, and
|
|
40
|
+
user profile information. It supports read operations for listing and retrieving email
|
|
41
|
+
data, as well as write operations including sending messages, managing drafts, modifying
|
|
42
|
+
message labels, and creating or updating labels.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Example questions
|
|
46
|
+
|
|
47
|
+
The Gmail connector is optimized to handle prompts like these.
|
|
48
|
+
|
|
49
|
+
- List my recent emails
|
|
50
|
+
- Show me unread messages in my inbox
|
|
51
|
+
- Get the details of a specific email
|
|
52
|
+
- List all my Gmail labels
|
|
53
|
+
- Show me details for a specific label
|
|
54
|
+
- List my email drafts
|
|
55
|
+
- Get the content of a specific draft
|
|
56
|
+
- List my email threads
|
|
57
|
+
- Show me the full thread for a conversation
|
|
58
|
+
- Get my Gmail profile information
|
|
59
|
+
- Send an email to someone
|
|
60
|
+
- Create a new email draft
|
|
61
|
+
- Archive a message by removing the INBOX label
|
|
62
|
+
- Mark a message as read
|
|
63
|
+
- Mark a message as unread
|
|
64
|
+
- Move a message to trash
|
|
65
|
+
- Create a new label
|
|
66
|
+
- Update a label name or settings
|
|
67
|
+
- Delete a label
|
|
68
|
+
- Search for messages matching a query
|
|
69
|
+
- Find emails from a specific sender
|
|
70
|
+
- Show me emails with attachments
|
|
71
|
+
|
|
72
|
+
## Unsupported questions
|
|
73
|
+
|
|
74
|
+
The Gmail connector isn't currently able to handle prompts like these.
|
|
75
|
+
|
|
76
|
+
- Attach a file to an email
|
|
77
|
+
- Forward an email to someone
|
|
78
|
+
- Create a filter or rule
|
|
79
|
+
- Manage Gmail settings
|
|
80
|
+
- Access Google Calendar events
|
|
81
|
+
- Manage contacts
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
uv pip install airbyte-agent-gmail
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Usage
|
|
90
|
+
|
|
91
|
+
Connectors can run in open source or hosted mode.
|
|
92
|
+
|
|
93
|
+
### Open source
|
|
94
|
+
|
|
95
|
+
In open source mode, you provide API credentials directly to the connector.
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from airbyte_agent_gmail import GmailConnector
|
|
99
|
+
from airbyte_agent_gmail.models import GmailAuthConfig
|
|
100
|
+
|
|
101
|
+
connector = GmailConnector(
|
|
102
|
+
auth_config=GmailAuthConfig(
|
|
103
|
+
access_token="<Your Google OAuth2 Access Token (optional, will be obtained via refresh)>",
|
|
104
|
+
refresh_token="<Your Google OAuth2 Refresh Token>",
|
|
105
|
+
client_id="<Your Google OAuth2 Client ID>",
|
|
106
|
+
client_secret="<Your Google OAuth2 Client Secret>"
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
@agent.tool_plain # assumes you're using Pydantic AI
|
|
111
|
+
@GmailConnector.tool_utils
|
|
112
|
+
async def gmail_execute(entity: str, action: str, params: dict | None = None):
|
|
113
|
+
return await connector.execute(entity, action, params or {})
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Hosted
|
|
117
|
+
|
|
118
|
+
In hosted mode, API credentials are stored securely in Airbyte Cloud. You provide your Airbyte credentials instead.
|
|
119
|
+
|
|
120
|
+
This example assumes you've already authenticated your connector with Airbyte. See [Authentication](AUTH.md) to learn more about authenticating. If you need a step-by-step guide, see the [hosted execution tutorial](https://docs.airbyte.com/ai-agents/quickstarts/tutorial-hosted).
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from airbyte_agent_gmail import GmailConnector, AirbyteAuthConfig
|
|
124
|
+
|
|
125
|
+
connector = GmailConnector(
|
|
126
|
+
auth_config=AirbyteAuthConfig(
|
|
127
|
+
external_user_id="<your_external_user_id>",
|
|
128
|
+
airbyte_client_id="<your-client-id>",
|
|
129
|
+
airbyte_client_secret="<your-client-secret>"
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
@agent.tool_plain # assumes you're using Pydantic AI
|
|
134
|
+
@GmailConnector.tool_utils
|
|
135
|
+
async def gmail_execute(entity: str, action: str, params: dict | None = None):
|
|
136
|
+
return await connector.execute(entity, action, params or {})
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Full documentation
|
|
140
|
+
|
|
141
|
+
### Entities and actions
|
|
142
|
+
|
|
143
|
+
This connector supports the following entities and actions. For more details, see this connector's [full reference documentation](REFERENCE.md).
|
|
144
|
+
|
|
145
|
+
| Entity | Actions |
|
|
146
|
+
|--------|---------|
|
|
147
|
+
| Profile | [Get](./REFERENCE.md#profile-get) |
|
|
148
|
+
| Messages | [List](./REFERENCE.md#messages-list), [Get](./REFERENCE.md#messages-get), [Create](./REFERENCE.md#messages-create), [Update](./REFERENCE.md#messages-update) |
|
|
149
|
+
| Labels | [List](./REFERENCE.md#labels-list), [Create](./REFERENCE.md#labels-create), [Get](./REFERENCE.md#labels-get), [Update](./REFERENCE.md#labels-update), [Delete](./REFERENCE.md#labels-delete) |
|
|
150
|
+
| Drafts | [List](./REFERENCE.md#drafts-list), [Create](./REFERENCE.md#drafts-create), [Get](./REFERENCE.md#drafts-get), [Update](./REFERENCE.md#drafts-update), [Delete](./REFERENCE.md#drafts-delete) |
|
|
151
|
+
| Drafts Send | [Create](./REFERENCE.md#drafts-send-create) |
|
|
152
|
+
| Threads | [List](./REFERENCE.md#threads-list), [Get](./REFERENCE.md#threads-get) |
|
|
153
|
+
| Messages Trash | [Create](./REFERENCE.md#messages-trash-create) |
|
|
154
|
+
| Messages Untrash | [Create](./REFERENCE.md#messages-untrash-create) |
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### Authentication
|
|
158
|
+
|
|
159
|
+
For all authentication options, see the connector's [authentication documentation](AUTH.md).
|
|
160
|
+
|
|
161
|
+
### Gmail API docs
|
|
162
|
+
|
|
163
|
+
See the official [Gmail API reference](https://developers.google.com/gmail/api/reference/rest).
|
|
164
|
+
|
|
165
|
+
## Version information
|
|
166
|
+
|
|
167
|
+
- **Package version:** 0.1.0
|
|
168
|
+
- **Connector version:** 0.1.0
|
|
169
|
+
- **Generated with Connector SDK commit SHA:** 7c00a573513c38c66c062e280768f79e987d8253
|
|
170
|
+
- **Changelog:** [View changelog](https://github.com/airbytehq/airbyte-agent-connectors/blob/main/connectors/gmail/CHANGELOG.md)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Gmail
|
|
2
|
+
|
|
3
|
+
The Gmail agent connector is a Python package that equips AI agents to interact with Gmail through strongly typed, well-documented tools. It's ready to use directly in your Python app, in an agent framework, or exposed through an MCP.
|
|
4
|
+
|
|
5
|
+
Gmail is Google's email service that provides email sending, receiving, and organization
|
|
6
|
+
capabilities. This connector provides access to messages, threads, labels, drafts, and
|
|
7
|
+
user profile information. It supports read operations for listing and retrieving email
|
|
8
|
+
data, as well as write operations including sending messages, managing drafts, modifying
|
|
9
|
+
message labels, and creating or updating labels.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Example questions
|
|
13
|
+
|
|
14
|
+
The Gmail connector is optimized to handle prompts like these.
|
|
15
|
+
|
|
16
|
+
- List my recent emails
|
|
17
|
+
- Show me unread messages in my inbox
|
|
18
|
+
- Get the details of a specific email
|
|
19
|
+
- List all my Gmail labels
|
|
20
|
+
- Show me details for a specific label
|
|
21
|
+
- List my email drafts
|
|
22
|
+
- Get the content of a specific draft
|
|
23
|
+
- List my email threads
|
|
24
|
+
- Show me the full thread for a conversation
|
|
25
|
+
- Get my Gmail profile information
|
|
26
|
+
- Send an email to someone
|
|
27
|
+
- Create a new email draft
|
|
28
|
+
- Archive a message by removing the INBOX label
|
|
29
|
+
- Mark a message as read
|
|
30
|
+
- Mark a message as unread
|
|
31
|
+
- Move a message to trash
|
|
32
|
+
- Create a new label
|
|
33
|
+
- Update a label name or settings
|
|
34
|
+
- Delete a label
|
|
35
|
+
- Search for messages matching a query
|
|
36
|
+
- Find emails from a specific sender
|
|
37
|
+
- Show me emails with attachments
|
|
38
|
+
|
|
39
|
+
## Unsupported questions
|
|
40
|
+
|
|
41
|
+
The Gmail connector isn't currently able to handle prompts like these.
|
|
42
|
+
|
|
43
|
+
- Attach a file to an email
|
|
44
|
+
- Forward an email to someone
|
|
45
|
+
- Create a filter or rule
|
|
46
|
+
- Manage Gmail settings
|
|
47
|
+
- Access Google Calendar events
|
|
48
|
+
- Manage contacts
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv pip install airbyte-agent-gmail
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
Connectors can run in open source or hosted mode.
|
|
59
|
+
|
|
60
|
+
### Open source
|
|
61
|
+
|
|
62
|
+
In open source mode, you provide API credentials directly to the connector.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from airbyte_agent_gmail import GmailConnector
|
|
66
|
+
from airbyte_agent_gmail.models import GmailAuthConfig
|
|
67
|
+
|
|
68
|
+
connector = GmailConnector(
|
|
69
|
+
auth_config=GmailAuthConfig(
|
|
70
|
+
access_token="<Your Google OAuth2 Access Token (optional, will be obtained via refresh)>",
|
|
71
|
+
refresh_token="<Your Google OAuth2 Refresh Token>",
|
|
72
|
+
client_id="<Your Google OAuth2 Client ID>",
|
|
73
|
+
client_secret="<Your Google OAuth2 Client Secret>"
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
@agent.tool_plain # assumes you're using Pydantic AI
|
|
78
|
+
@GmailConnector.tool_utils
|
|
79
|
+
async def gmail_execute(entity: str, action: str, params: dict | None = None):
|
|
80
|
+
return await connector.execute(entity, action, params or {})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Hosted
|
|
84
|
+
|
|
85
|
+
In hosted mode, API credentials are stored securely in Airbyte Cloud. You provide your Airbyte credentials instead.
|
|
86
|
+
|
|
87
|
+
This example assumes you've already authenticated your connector with Airbyte. See [Authentication](AUTH.md) to learn more about authenticating. If you need a step-by-step guide, see the [hosted execution tutorial](https://docs.airbyte.com/ai-agents/quickstarts/tutorial-hosted).
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from airbyte_agent_gmail import GmailConnector, AirbyteAuthConfig
|
|
91
|
+
|
|
92
|
+
connector = GmailConnector(
|
|
93
|
+
auth_config=AirbyteAuthConfig(
|
|
94
|
+
external_user_id="<your_external_user_id>",
|
|
95
|
+
airbyte_client_id="<your-client-id>",
|
|
96
|
+
airbyte_client_secret="<your-client-secret>"
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
@agent.tool_plain # assumes you're using Pydantic AI
|
|
101
|
+
@GmailConnector.tool_utils
|
|
102
|
+
async def gmail_execute(entity: str, action: str, params: dict | None = None):
|
|
103
|
+
return await connector.execute(entity, action, params or {})
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Full documentation
|
|
107
|
+
|
|
108
|
+
### Entities and actions
|
|
109
|
+
|
|
110
|
+
This connector supports the following entities and actions. For more details, see this connector's [full reference documentation](REFERENCE.md).
|
|
111
|
+
|
|
112
|
+
| Entity | Actions |
|
|
113
|
+
|--------|---------|
|
|
114
|
+
| Profile | [Get](./REFERENCE.md#profile-get) |
|
|
115
|
+
| Messages | [List](./REFERENCE.md#messages-list), [Get](./REFERENCE.md#messages-get), [Create](./REFERENCE.md#messages-create), [Update](./REFERENCE.md#messages-update) |
|
|
116
|
+
| Labels | [List](./REFERENCE.md#labels-list), [Create](./REFERENCE.md#labels-create), [Get](./REFERENCE.md#labels-get), [Update](./REFERENCE.md#labels-update), [Delete](./REFERENCE.md#labels-delete) |
|
|
117
|
+
| Drafts | [List](./REFERENCE.md#drafts-list), [Create](./REFERENCE.md#drafts-create), [Get](./REFERENCE.md#drafts-get), [Update](./REFERENCE.md#drafts-update), [Delete](./REFERENCE.md#drafts-delete) |
|
|
118
|
+
| Drafts Send | [Create](./REFERENCE.md#drafts-send-create) |
|
|
119
|
+
| Threads | [List](./REFERENCE.md#threads-list), [Get](./REFERENCE.md#threads-get) |
|
|
120
|
+
| Messages Trash | [Create](./REFERENCE.md#messages-trash-create) |
|
|
121
|
+
| Messages Untrash | [Create](./REFERENCE.md#messages-untrash-create) |
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Authentication
|
|
125
|
+
|
|
126
|
+
For all authentication options, see the connector's [authentication documentation](AUTH.md).
|
|
127
|
+
|
|
128
|
+
### Gmail API docs
|
|
129
|
+
|
|
130
|
+
See the official [Gmail API reference](https://developers.google.com/gmail/api/reference/rest).
|
|
131
|
+
|
|
132
|
+
## Version information
|
|
133
|
+
|
|
134
|
+
- **Package version:** 0.1.0
|
|
135
|
+
- **Connector version:** 0.1.0
|
|
136
|
+
- **Generated with Connector SDK commit SHA:** 7c00a573513c38c66c062e280768f79e987d8253
|
|
137
|
+
- **Changelog:** [View changelog](https://github.com/airbytehq/airbyte-agent-connectors/blob/main/connectors/gmail/CHANGELOG.md)
|