Skip to content

Commit b3c33ec

Browse files
committed
Release 0.0.11
1 parent 61340ae commit b3c33ec

26 files changed

+389
-65
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "agentmail"
33

44
[tool.poetry]
55
name = "agentmail"
6-
version = "0.0.10"
6+
version = "0.0.11"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ from agentmail import AgentMail
1818
client = AgentMail(
1919
api_key="YOUR_API_KEY",
2020
)
21-
client.inboxes.list()
21+
client.inboxes.list(
22+
limit=10,
23+
last_key="123e4567-e89b-12d3-a456-426614174000",
24+
)
2225

2326
```
2427
</dd>
@@ -81,7 +84,7 @@ client = AgentMail(
8184
api_key="YOUR_API_KEY",
8285
)
8386
client.inboxes.get(
84-
inbox_id="inbox_id",
87+
inbox_id="yourinbox@agentmail.to",
8588
)
8689

8790
```
@@ -224,7 +227,8 @@ client = AgentMail(
224227
api_key="YOUR_API_KEY",
225228
)
226229
client.messages.list(
227-
inbox_id="inbox_id",
230+
inbox_id="yourinbox@agentmail.to",
231+
limit=10,
228232
)
229233

230234
```
@@ -312,8 +316,8 @@ client = AgentMail(
312316
api_key="YOUR_API_KEY",
313317
)
314318
client.messages.get(
315-
inbox_id="inbox_id",
316-
message_id="message_id",
319+
inbox_id="yourinbox@agentmail.to",
320+
message_id="msg_123",
317321
)
318322

319323
```
@@ -377,8 +381,13 @@ client = AgentMail(
377381
api_key="YOUR_API_KEY",
378382
)
379383
client.messages.send(
380-
inbox_id="inbox_id",
381-
to="to",
384+
inbox_id="yourinbox@agentmail.to",
385+
to=["bob@example.com"],
386+
cc=["charlie@example.com"],
387+
bcc=["david@example.com"],
388+
subject="Project Discussion",
389+
text="Let's review the timeline for the project.",
390+
html="<p>Let's review the timeline for the project.</p>",
382391
)
383392

384393
```
@@ -482,8 +491,12 @@ client = AgentMail(
482491
api_key="YOUR_API_KEY",
483492
)
484493
client.messages.reply(
485-
inbox_id="inbox_id",
486-
message_id="message_id",
494+
inbox_id="yourinbox@agentmail.to",
495+
message_id="msg_123",
496+
text="Thanks for the update. Let's meet tomorrow at 2 PM.",
497+
html="<p>Thanks for the update. Let's meet tomorrow at 2 PM.</p>",
498+
cc=["charlie@example.com"],
499+
bcc=["david@example.com"],
487500
)
488501

489502
```
@@ -602,7 +615,8 @@ client = AgentMail(
602615
api_key="YOUR_API_KEY",
603616
)
604617
client.threads.list(
605-
inbox_id="inbox_id",
618+
inbox_id="yourinbox@agentmail.to",
619+
limit=10,
606620
)
607621

608622
```
@@ -690,8 +704,8 @@ client = AgentMail(
690704
api_key="YOUR_API_KEY",
691705
)
692706
client.threads.get(
693-
inbox_id="inbox_id",
694-
thread_id="thread_id",
707+
inbox_id="yourinbox@agentmail.to",
708+
thread_id="thread_123",
695709
)
696710

697711
```

src/agentmail/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
from .messages import (
1010
Addresses,
1111
Attachment,
12+
AttachmentContentType,
13+
AttachmentFilename,
1214
AttachmentId,
15+
AttachmentInline,
16+
AttachmentSize,
1317
ListMessagesResponse,
1418
Message,
1519
MessageAttachments,
@@ -35,8 +39,11 @@
3539
from .threads import (
3640
ListThreadsResponse,
3741
Thread,
42+
ThreadAttachment,
43+
ThreadAttachments,
3844
ThreadId,
3945
ThreadItem,
46+
ThreadMessageCount,
4047
ThreadParticipants,
4148
ThreadPreview,
4249
ThreadSubject,
@@ -50,7 +57,11 @@
5057
"AgentMailEnvironment",
5158
"AsyncAgentMail",
5259
"Attachment",
60+
"AttachmentContentType",
61+
"AttachmentFilename",
5362
"AttachmentId",
63+
"AttachmentInline",
64+
"AttachmentSize",
5465
"Count",
5566
"CreateInboxRequest",
5667
"DisplayName",
@@ -88,8 +99,11 @@
8899
"SendMessageTo",
89100
"Sent",
90101
"Thread",
102+
"ThreadAttachment",
103+
"ThreadAttachments",
91104
"ThreadId",
92105
"ThreadItem",
106+
"ThreadMessageCount",
93107
"ThreadParticipants",
94108
"ThreadPreview",
95109
"ThreadSubject",

src/agentmail/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_headers(self) -> typing.Dict[str, str]:
2222
headers: typing.Dict[str, str] = {
2323
"X-Fern-Language": "Python",
2424
"X-Fern-SDK-Name": "agentmail",
25-
"X-Fern-SDK-Version": "0.0.10",
25+
"X-Fern-SDK-Version": "0.0.11",
2626
}
2727
headers["Authorization"] = f"Bearer {self._get_api_key()}"
2828
return headers

src/agentmail/core/http_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def request(
183183
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
184184
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
185185
request_options: typing.Optional[RequestOptions] = None,
186-
retries: int = 0,
186+
retries: int = 2,
187187
omit: typing.Optional[typing.Any] = None,
188188
) -> httpx.Response:
189189
base_url = self.get_base_url(base_url)
@@ -269,7 +269,7 @@ def stream(
269269
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
270270
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
271271
request_options: typing.Optional[RequestOptions] = None,
272-
retries: int = 0,
272+
retries: int = 2,
273273
omit: typing.Optional[typing.Any] = None,
274274
) -> typing.Iterator[httpx.Response]:
275275
base_url = self.get_base_url(base_url)
@@ -359,7 +359,7 @@ async def request(
359359
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
360360
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
361361
request_options: typing.Optional[RequestOptions] = None,
362-
retries: int = 0,
362+
retries: int = 2,
363363
omit: typing.Optional[typing.Any] = None,
364364
) -> httpx.Response:
365365
base_url = self.get_base_url(base_url)
@@ -445,7 +445,7 @@ async def stream(
445445
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
446446
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
447447
request_options: typing.Optional[RequestOptions] = None,
448-
retries: int = 0,
448+
retries: int = 2,
449449
omit: typing.Optional[typing.Any] = None,
450450
) -> typing.AsyncIterator[httpx.Response]:
451451
base_url = self.get_base_url(base_url)

src/agentmail/inboxes/client.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def list(
5555
client = AgentMail(
5656
api_key="YOUR_API_KEY",
5757
)
58-
client.inboxes.list()
58+
client.inboxes.list(
59+
limit=10,
60+
last_key="123e4567-e89b-12d3-a456-426614174000",
61+
)
5962
"""
6063
_response = self._client_wrapper.httpx_client.request(
6164
"v0/inboxes",
@@ -101,7 +104,7 @@ def get(self, inbox_id: InboxId, *, request_options: typing.Optional[RequestOpti
101104
api_key="YOUR_API_KEY",
102105
)
103106
client.inboxes.get(
104-
inbox_id="inbox_id",
107+
inbox_id="yourinbox@agentmail.to",
105108
)
106109
"""
107110
_response = self._client_wrapper.httpx_client.request(
@@ -244,7 +247,10 @@ async def list(
244247
245248
246249
async def main() -> None:
247-
await client.inboxes.list()
250+
await client.inboxes.list(
251+
limit=10,
252+
last_key="123e4567-e89b-12d3-a456-426614174000",
253+
)
248254
249255
250256
asyncio.run(main())
@@ -298,7 +304,7 @@ async def get(self, inbox_id: InboxId, *, request_options: typing.Optional[Reque
298304
299305
async def main() -> None:
300306
await client.inboxes.get(
301-
inbox_id="inbox_id",
307+
inbox_id="yourinbox@agentmail.to",
302308
)
303309
304310

src/agentmail/inboxes/types/list_inboxes_response.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,30 @@
1111

1212

1313
class ListInboxesResponse(UniversalBaseModel):
14+
"""
15+
Examples
16+
--------
17+
import datetime
18+
19+
from agentmail.inboxes import Inbox, ListInboxesResponse
20+
21+
ListInboxesResponse(
22+
inboxes=[
23+
Inbox(
24+
inbox_id="yourinbox@agentmail.to",
25+
organization_id="123e4567-e89b-12d3-a456-426614174000",
26+
display_name="Your Inbox",
27+
created_at=datetime.datetime.fromisoformat(
28+
"2024-01-15 09:30:00+00:00",
29+
),
30+
)
31+
],
32+
limit=10,
33+
count=1,
34+
last_key="123e4567-e89b-12d3-a456-426614174000",
35+
)
36+
"""
37+
1438
inboxes: typing.List[Inbox] = pydantic.Field()
1539
"""
1640
Inbox items. Ordered by `created_at` ascending.

src/agentmail/messages/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
from .types import (
44
Addresses,
55
Attachment,
6+
AttachmentContentType,
7+
AttachmentFilename,
68
AttachmentId,
9+
AttachmentInline,
10+
AttachmentSize,
711
ListMessagesResponse,
812
Message,
913
MessageAttachments,
@@ -30,7 +34,11 @@
3034
__all__ = [
3135
"Addresses",
3236
"Attachment",
37+
"AttachmentContentType",
38+
"AttachmentFilename",
3339
"AttachmentId",
40+
"AttachmentInline",
41+
"AttachmentSize",
3442
"ListMessagesResponse",
3543
"Message",
3644
"MessageAttachments",

src/agentmail/messages/client.py

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def list(
7878
api_key="YOUR_API_KEY",
7979
)
8080
client.messages.list(
81-
inbox_id="inbox_id",
81+
inbox_id="yourinbox@agentmail.to",
82+
limit=10,
8283
)
8384
"""
8485
_response = self._client_wrapper.httpx_client.request(
@@ -141,8 +142,8 @@ def get(
141142
api_key="YOUR_API_KEY",
142143
)
143144
client.messages.get(
144-
inbox_id="inbox_id",
145-
message_id="message_id",
145+
inbox_id="yourinbox@agentmail.to",
146+
message_id="msg_123",
146147
)
147148
"""
148149
_response = self._client_wrapper.httpx_client.request(
@@ -269,8 +270,13 @@ def send(
269270
api_key="YOUR_API_KEY",
270271
)
271272
client.messages.send(
272-
inbox_id="inbox_id",
273-
to="to",
273+
inbox_id="yourinbox@agentmail.to",
274+
to=["bob@example.com"],
275+
cc=["charlie@example.com"],
276+
bcc=["david@example.com"],
277+
subject="Project Discussion",
278+
text="Let's review the timeline for the project.",
279+
html="<p>Let's review the timeline for the project.</p>",
274280
)
275281
"""
276282
_response = self._client_wrapper.httpx_client.request(
@@ -367,8 +373,12 @@ def reply(
367373
api_key="YOUR_API_KEY",
368374
)
369375
client.messages.reply(
370-
inbox_id="inbox_id",
371-
message_id="message_id",
376+
inbox_id="yourinbox@agentmail.to",
377+
message_id="msg_123",
378+
text="Thanks for the update. Let's meet tomorrow at 2 PM.",
379+
html="<p>Thanks for the update. Let's meet tomorrow at 2 PM.</p>",
380+
cc=["charlie@example.com"],
381+
bcc=["david@example.com"],
372382
)
373383
"""
374384
_response = self._client_wrapper.httpx_client.request(
@@ -470,7 +480,8 @@ async def list(
470480
471481
async def main() -> None:
472482
await client.messages.list(
473-
inbox_id="inbox_id",
483+
inbox_id="yourinbox@agentmail.to",
484+
limit=10,
474485
)
475486
476487
@@ -541,8 +552,8 @@ async def get(
541552
542553
async def main() -> None:
543554
await client.messages.get(
544-
inbox_id="inbox_id",
545-
message_id="message_id",
555+
inbox_id="yourinbox@agentmail.to",
556+
message_id="msg_123",
546557
)
547558
548559
@@ -677,8 +688,13 @@ async def send(
677688
678689
async def main() -> None:
679690
await client.messages.send(
680-
inbox_id="inbox_id",
681-
to="to",
691+
inbox_id="yourinbox@agentmail.to",
692+
to=["bob@example.com"],
693+
cc=["charlie@example.com"],
694+
bcc=["david@example.com"],
695+
subject="Project Discussion",
696+
text="Let's review the timeline for the project.",
697+
html="<p>Let's review the timeline for the project.</p>",
682698
)
683699
684700
@@ -783,8 +799,12 @@ async def reply(
783799
784800
async def main() -> None:
785801
await client.messages.reply(
786-
inbox_id="inbox_id",
787-
message_id="message_id",
802+
inbox_id="yourinbox@agentmail.to",
803+
message_id="msg_123",
804+
text="Thanks for the update. Let's meet tomorrow at 2 PM.",
805+
html="<p>Thanks for the update. Let's meet tomorrow at 2 PM.</p>",
806+
cc=["charlie@example.com"],
807+
bcc=["david@example.com"],
788808
)
789809
790810

0 commit comments

Comments
 (0)