Skip to content

Commit 0d524a1

Browse files
Removing unsupported getEmailMetadata method and adding modify method (openai#1590)
1 parent 52f7083 commit 0d524a1

File tree

1 file changed

+97
-26
lines changed

1 file changed

+97
-26
lines changed

examples/chatgpt/gpt_actions_library/gpt_action_gmail.ipynb

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,15 @@
164164
"outputs": [],
165165
"source": [
166166
"openapi: 3.1.0\n",
167+
"\n",
167168
"info:\n",
168169
" title: Gmail Email API\n",
169170
" version: 1.0.0\n",
170171
" description: API to read, write, and send emails in a Gmail account.\n",
172+
"\n",
171173
"servers:\n",
172174
" - url: https://gmail.googleapis.com\n",
175+
"\n",
173176
"paths:\n",
174177
" /gmail/v1/users/{userId}/messages:\n",
175178
" get:\n",
@@ -197,6 +200,7 @@
197200
" in: query\n",
198201
" schema:\n",
199202
" type: integer\n",
203+
" format: int32\n",
200204
" description: Maximum number of messages to return.\n",
201205
" responses:\n",
202206
" '200':\n",
@@ -215,6 +219,7 @@
215219
" description: Not Found\n",
216220
" '500':\n",
217221
" description: Internal Server Error\n",
222+
"\n",
218223
" /gmail/v1/users/{userId}/messages/send:\n",
219224
" post:\n",
220225
" summary: Send Email\n",
@@ -248,6 +253,7 @@
248253
" description: Forbidden\n",
249254
" '500':\n",
250255
" description: Internal Server Error\n",
256+
"\n",
251257
" /gmail/v1/users/{userId}/messages/{id}:\n",
252258
" get:\n",
253259
" summary: Read Email\n",
@@ -283,11 +289,12 @@
283289
" description: Not Found\n",
284290
" '500':\n",
285291
" description: Internal Server Error\n",
286-
" /gmail/v1/users/{userId}/messages/{id}/metadata:\n",
287-
" get:\n",
288-
" summary: Get Email Metadata\n",
289-
" description: Gets the metadata of an email, including subject line.\n",
290-
" operationId: getEmailMetadata\n",
292+
"\n",
293+
" /gmail/v1/users/{userId}/messages/{id}/modify:\n",
294+
" post:\n",
295+
" summary: Modify Label\n",
296+
" description: Modify labels of an email.\n",
297+
" operationId: modifyLabels\n",
291298
" parameters:\n",
292299
" - name: userId\n",
293300
" in: path\n",
@@ -300,24 +307,29 @@
300307
" required: true\n",
301308
" schema:\n",
302309
" type: string\n",
303-
" description: The ID of the email to retrieve metadata for.\n",
310+
" description: The ID of the email to change labels.\n",
311+
" requestBody:\n",
312+
" required: true\n",
313+
" content:\n",
314+
" application/json:\n",
315+
" schema:\n",
316+
" $ref: '#/components/schemas/LabelModification'\n",
304317
" responses:\n",
305318
" '200':\n",
306-
" description: Successful response\n",
319+
" description: Labels modified successfully\n",
307320
" content:\n",
308321
" application/json:\n",
309322
" schema:\n",
310-
" $ref: '#/components/schemas/MessageMetadata'\n",
323+
" $ref: '#/components/schemas/Message'\n",
311324
" '400':\n",
312325
" description: Bad Request\n",
313326
" '401':\n",
314327
" description: Unauthorized\n",
315328
" '403':\n",
316329
" description: Forbidden\n",
317-
" '404':\n",
318-
" description: Not Found\n",
319330
" '500':\n",
320331
" description: Internal Server Error\n",
332+
"\n",
321333
" /gmail/v1/users/{userId}/drafts:\n",
322334
" post:\n",
323335
" summary: Create Draft\n",
@@ -351,6 +363,41 @@
351363
" description: Forbidden\n",
352364
" '500':\n",
353365
" description: Internal Server Error\n",
366+
"\n",
367+
" /gmail/v1/users/{userId}/drafts/send:\n",
368+
" post:\n",
369+
" summary: Send Draft\n",
370+
" description: Sends an existing email draft.\n",
371+
" operationId: sendDraft\n",
372+
" parameters:\n",
373+
" - name: userId\n",
374+
" in: path\n",
375+
" required: true\n",
376+
" schema:\n",
377+
" type: string\n",
378+
" description: The user's email address. Use \"me\" to indicate the authenticated user.\n",
379+
" requestBody:\n",
380+
" required: true\n",
381+
" content:\n",
382+
" application/json:\n",
383+
" schema:\n",
384+
" $ref: '#/components/schemas/SendDraftRequest'\n",
385+
" responses:\n",
386+
" '200':\n",
387+
" description: Draft sent successfully\n",
388+
" content:\n",
389+
" application/json:\n",
390+
" schema:\n",
391+
" $ref: '#/components/schemas/Message'\n",
392+
" '400':\n",
393+
" description: Bad Request\n",
394+
" '401':\n",
395+
" description: Unauthorized\n",
396+
" '403':\n",
397+
" description: Forbidden\n",
398+
" '500':\n",
399+
" description: Internal Server Error\n",
400+
"\n",
354401
"components:\n",
355402
" schemas:\n",
356403
" MessageList:\n",
@@ -362,6 +409,7 @@
362409
" $ref: '#/components/schemas/Message'\n",
363410
" nextPageToken:\n",
364411
" type: string\n",
412+
"\n",
365413
" Message:\n",
366414
" type: object\n",
367415
" properties:\n",
@@ -373,12 +421,21 @@
373421
" type: array\n",
374422
" items:\n",
375423
" type: string\n",
424+
" addLabelIds:\n",
425+
" type: array\n",
426+
" items:\n",
427+
" type: string\n",
428+
" removeLabelIds:\n",
429+
" type: array\n",
430+
" items:\n",
431+
" type: string\n",
376432
" snippet:\n",
377433
" type: string\n",
378434
" raw:\n",
379435
" type: string\n",
380436
" format: byte\n",
381437
" description: The entire email message in an RFC 2822 formatted and base64url encoded string.\n",
438+
"\n",
382439
" FullMessage:\n",
383440
" type: object\n",
384441
" properties:\n",
@@ -416,28 +473,31 @@
416473
" properties:\n",
417474
" data:\n",
418475
" type: string\n",
419-
" MessageMetadata:\n",
476+
"\n",
477+
" LabelModification:\n",
420478
" type: object\n",
421479
" properties:\n",
422-
" id:\n",
423-
" type: string\n",
424-
" threadId:\n",
425-
" type: string\n",
426-
" labelIds:\n",
480+
" addLabelIds:\n",
427481
" type: array\n",
428482
" items:\n",
429483
" type: string\n",
430-
" snippet:\n",
431-
" type: string\n",
432-
" headers:\n",
484+
" removeLabelIds:\n",
485+
" type: array\n",
486+
" items:\n",
487+
" type: string\n",
488+
"\n",
489+
" Label:\n",
490+
" type: object\n",
491+
" properties:\n",
492+
" addLabelIds:\n",
493+
" type: array\n",
494+
" items:\n",
495+
" type: string\n",
496+
" removeLabelIds:\n",
433497
" type: array\n",
434498
" items:\n",
435-
" type: object\n",
436-
" properties:\n",
437-
" name:\n",
438-
" type: string\n",
439-
" value:\n",
440-
" type: string\n",
499+
" type: string\n",
500+
"\n",
441501
" EmailDraft:\n",
442502
" type: object\n",
443503
" properties:\n",
@@ -463,13 +523,24 @@
463523
" enum: [text/plain, text/html]\n",
464524
" content:\n",
465525
" type: string\n",
526+
"\n",
466527
" Draft:\n",
467528
" type: object\n",
468529
" properties:\n",
469530
" id:\n",
470531
" type: string\n",
471532
" message:\n",
472-
" $ref: '#/components/schemas/Message'"
533+
" $ref: '#/components/schemas/Message'\n",
534+
"\n",
535+
" SendDraftRequest:\n",
536+
" type: object\n",
537+
" properties:\n",
538+
" draftId:\n",
539+
" type: string\n",
540+
" description: The ID of the draft to send.\n",
541+
" userId:\n",
542+
" type: string\n",
543+
" description: The user's email address. Use \"me\" to indicate the authenticated user."
473544
]
474545
},
475546
{

0 commit comments

Comments
 (0)