Skip to content

Commit 2cf2c78

Browse files
Release 0.2.10
1 parent 6b69712 commit 2cf2c78

File tree

7 files changed

+45
-4
lines changed

7 files changed

+45
-4
lines changed

.fern/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
},
1010
"should_generate_websocket_clients": true
1111
},
12-
"sdkVersion": "0.2.9"
12+
"sdkVersion": "0.2.10"
1313
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dynamic = ["version"]
44

55
[tool.poetry]
66
name = "agentmail"
7-
version = "0.2.9"
7+
version = "0.2.10"
88
description = ""
99
readme = "README.md"
1010
authors = []

reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,14 @@ client.inboxes.drafts.create(
18381838
<dl>
18391839
<dd>
18401840

1841+
**attachments:** `typing.Optional[typing.Sequence[SendAttachment]]` — Attachments to include in draft.
1842+
1843+
</dd>
1844+
</dl>
1845+
1846+
<dl>
1847+
<dd>
1848+
18411849
**in_reply_to:** `typing.Optional[DraftInReplyTo]`
18421850

18431851
</dd>

src/agentmail/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def get_headers(self) -> typing.Dict[str, str]:
2525
import platform
2626

2727
headers: typing.Dict[str, str] = {
28-
"User-Agent": "agentmail/0.2.9",
28+
"User-Agent": "agentmail/0.2.10",
2929
"X-Fern-Language": "Python",
3030
"X-Fern-Runtime": f"python/{platform.python_version()}",
3131
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
3232
"X-Fern-SDK-Name": "agentmail",
33-
"X-Fern-SDK-Version": "0.2.9",
33+
"X-Fern-SDK-Version": "0.2.10",
3434
**(self.get_custom_headers() or {}),
3535
}
3636
headers["Authorization"] = f"Bearer {self._get_api_key()}"

src/agentmail/drafts/types/create_draft_request.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import typing
44

55
import pydantic
6+
from ...attachments.types.send_attachment import SendAttachment
67
from ...core.pydantic_utilities import IS_PYDANTIC_V2
78
from ...core.unchecked_base_model import UncheckedBaseModel
89
from .draft_bcc import DraftBcc
@@ -27,6 +28,11 @@ class CreateDraftRequest(UncheckedBaseModel):
2728
subject: typing.Optional[DraftSubject] = None
2829
text: typing.Optional[DraftText] = None
2930
html: typing.Optional[DraftHtml] = None
31+
attachments: typing.Optional[typing.List[SendAttachment]] = pydantic.Field(default=None)
32+
"""
33+
Attachments to include in draft.
34+
"""
35+
3036
in_reply_to: typing.Optional[DraftInReplyTo] = None
3137
send_at: typing.Optional[DraftSendAt] = None
3238
client_id: typing.Optional[DraftClientId] = None

src/agentmail/inboxes/drafts/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import typing
44

5+
from ...attachments.types.send_attachment import SendAttachment
56
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
67
from ...core.request_options import RequestOptions
78
from ...drafts.types.draft import Draft
@@ -150,6 +151,7 @@ def create(
150151
subject: typing.Optional[DraftSubject] = OMIT,
151152
text: typing.Optional[DraftText] = OMIT,
152153
html: typing.Optional[DraftHtml] = OMIT,
154+
attachments: typing.Optional[typing.Sequence[SendAttachment]] = OMIT,
153155
in_reply_to: typing.Optional[DraftInReplyTo] = OMIT,
154156
send_at: typing.Optional[DraftSendAt] = OMIT,
155157
client_id: typing.Optional[DraftClientId] = OMIT,
@@ -176,6 +178,9 @@ def create(
176178
177179
html : typing.Optional[DraftHtml]
178180
181+
attachments : typing.Optional[typing.Sequence[SendAttachment]]
182+
Attachments to include in draft.
183+
179184
in_reply_to : typing.Optional[DraftInReplyTo]
180185
181186
send_at : typing.Optional[DraftSendAt]
@@ -210,6 +215,7 @@ def create(
210215
subject=subject,
211216
text=text,
212217
html=html,
218+
attachments=attachments,
213219
in_reply_to=in_reply_to,
214220
send_at=send_at,
215221
client_id=client_id,
@@ -502,6 +508,7 @@ async def create(
502508
subject: typing.Optional[DraftSubject] = OMIT,
503509
text: typing.Optional[DraftText] = OMIT,
504510
html: typing.Optional[DraftHtml] = OMIT,
511+
attachments: typing.Optional[typing.Sequence[SendAttachment]] = OMIT,
505512
in_reply_to: typing.Optional[DraftInReplyTo] = OMIT,
506513
send_at: typing.Optional[DraftSendAt] = OMIT,
507514
client_id: typing.Optional[DraftClientId] = OMIT,
@@ -528,6 +535,9 @@ async def create(
528535
529536
html : typing.Optional[DraftHtml]
530537
538+
attachments : typing.Optional[typing.Sequence[SendAttachment]]
539+
Attachments to include in draft.
540+
531541
in_reply_to : typing.Optional[DraftInReplyTo]
532542
533543
send_at : typing.Optional[DraftSendAt]
@@ -570,6 +580,7 @@ async def main() -> None:
570580
subject=subject,
571581
text=text,
572582
html=html,
583+
attachments=attachments,
573584
in_reply_to=in_reply_to,
574585
send_at=send_at,
575586
client_id=client_id,

src/agentmail/inboxes/drafts/raw_client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
import typing
44
from json.decoder import JSONDecodeError
55

6+
from ...attachments.types.send_attachment import SendAttachment
67
from ...core.api_error import ApiError
78
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
89
from ...core.datetime_utils import serialize_datetime
910
from ...core.http_response import AsyncHttpResponse, HttpResponse
1011
from ...core.jsonable_encoder import jsonable_encoder
1112
from ...core.request_options import RequestOptions
13+
from ...core.serialization import convert_and_respect_annotation_metadata
1214
from ...core.unchecked_base_model import construct_type
1315
from ...drafts.types.draft import Draft
1416
from ...drafts.types.draft_bcc import DraftBcc
@@ -183,6 +185,7 @@ def create(
183185
subject: typing.Optional[DraftSubject] = OMIT,
184186
text: typing.Optional[DraftText] = OMIT,
185187
html: typing.Optional[DraftHtml] = OMIT,
188+
attachments: typing.Optional[typing.Sequence[SendAttachment]] = OMIT,
186189
in_reply_to: typing.Optional[DraftInReplyTo] = OMIT,
187190
send_at: typing.Optional[DraftSendAt] = OMIT,
188191
client_id: typing.Optional[DraftClientId] = OMIT,
@@ -209,6 +212,9 @@ def create(
209212
210213
html : typing.Optional[DraftHtml]
211214
215+
attachments : typing.Optional[typing.Sequence[SendAttachment]]
216+
Attachments to include in draft.
217+
212218
in_reply_to : typing.Optional[DraftInReplyTo]
213219
214220
send_at : typing.Optional[DraftSendAt]
@@ -235,6 +241,9 @@ def create(
235241
"subject": subject,
236242
"text": text,
237243
"html": html,
244+
"attachments": convert_and_respect_annotation_metadata(
245+
object_=attachments, annotation=typing.Sequence[SendAttachment], direction="write"
246+
),
238247
"in_reply_to": in_reply_to,
239248
"send_at": send_at,
240249
"client_id": client_id,
@@ -628,6 +637,7 @@ async def create(
628637
subject: typing.Optional[DraftSubject] = OMIT,
629638
text: typing.Optional[DraftText] = OMIT,
630639
html: typing.Optional[DraftHtml] = OMIT,
640+
attachments: typing.Optional[typing.Sequence[SendAttachment]] = OMIT,
631641
in_reply_to: typing.Optional[DraftInReplyTo] = OMIT,
632642
send_at: typing.Optional[DraftSendAt] = OMIT,
633643
client_id: typing.Optional[DraftClientId] = OMIT,
@@ -654,6 +664,9 @@ async def create(
654664
655665
html : typing.Optional[DraftHtml]
656666
667+
attachments : typing.Optional[typing.Sequence[SendAttachment]]
668+
Attachments to include in draft.
669+
657670
in_reply_to : typing.Optional[DraftInReplyTo]
658671
659672
send_at : typing.Optional[DraftSendAt]
@@ -680,6 +693,9 @@ async def create(
680693
"subject": subject,
681694
"text": text,
682695
"html": html,
696+
"attachments": convert_and_respect_annotation_metadata(
697+
object_=attachments, annotation=typing.Sequence[SendAttachment], direction="write"
698+
),
683699
"in_reply_to": in_reply_to,
684700
"send_at": send_at,
685701
"client_id": client_id,

0 commit comments

Comments
 (0)