mailsai 0.2.2__tar.gz → 0.2.3__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.
- {mailsai-0.2.2 → mailsai-0.2.3}/PKG-INFO +1 -1
- {mailsai-0.2.2 → mailsai-0.2.3}/mailsai/__init__.py +19 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/mailsai.egg-info/PKG-INFO +1 -1
- {mailsai-0.2.2 → mailsai-0.2.3}/pyproject.toml +1 -1
- {mailsai-0.2.2 → mailsai-0.2.3}/LICENSE +0 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/README.md +0 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/mailsai.egg-info/SOURCES.txt +0 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/mailsai.egg-info/dependency_links.txt +0 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/mailsai.egg-info/requires.txt +0 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/mailsai.egg-info/top_level.txt +0 -0
- {mailsai-0.2.2 → mailsai-0.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mailsai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Email API for AI agents — Python SDK. Per-agent email addresses on your domain, per-agent reputation, and prompt-injection scanning on every inbound. Send, receive structured inbound replies, and identify agents via REST. Intent + entity extraction is opt-in.
|
|
5
5
|
Author-email: "Mails.ai" <support@mails.ai>
|
|
6
6
|
License: MIT
|
|
@@ -98,6 +98,22 @@ def _require_httpx() -> Any:
|
|
|
98
98
|
return httpx
|
|
99
99
|
|
|
100
100
|
|
|
101
|
+
def _fold_body(kwargs: Dict[str, Any]) -> None:
|
|
102
|
+
"""Fold the ergonomic aliases into the canonical fields, in place.
|
|
103
|
+
|
|
104
|
+
`body` is an SDK-level convenience the TypeScript client has always had
|
|
105
|
+
(`body_text: input.body_text ?? input.body`), and `text`/`html` are the Resend-shaped
|
|
106
|
+
aliases the API accepts. This client had NEITHER on Client.send() — only on the
|
|
107
|
+
Agent.send() helper — so the exact snippet in our own README, `send(**{"from": …,
|
|
108
|
+
"body": …})`, reached the server with an unknown `body` field and came back
|
|
109
|
+
"At least one of html (or body_html) and text (or body_text) is required".
|
|
110
|
+
Explicit canonical fields always win.
|
|
111
|
+
"""
|
|
112
|
+
text = kwargs.pop("body", None)
|
|
113
|
+
if kwargs.get("body_text") is None and kwargs.get("text") is None and text is not None:
|
|
114
|
+
kwargs["body_text"] = text
|
|
115
|
+
|
|
116
|
+
|
|
101
117
|
class Client:
|
|
102
118
|
"""Low-level Mails.ai REST client."""
|
|
103
119
|
|
|
@@ -238,6 +254,7 @@ class Client:
|
|
|
238
254
|
idempotency_key = kwargs.pop("idempotency_key", None)
|
|
239
255
|
if agent is not None:
|
|
240
256
|
kwargs["agent"] = agent
|
|
257
|
+
_fold_body(kwargs)
|
|
241
258
|
body = {k: v for k, v in kwargs.items() if v is not None}
|
|
242
259
|
headers = {"Idempotency-Key": idempotency_key} if idempotency_key else None
|
|
243
260
|
return self._request("POST", "/api/v1/messages", body, headers)
|
|
@@ -252,10 +269,12 @@ class Client:
|
|
|
252
269
|
return self._request("GET", "/api/v1/me")
|
|
253
270
|
|
|
254
271
|
def reply(self, message_id: str, **kwargs: Any) -> Dict[str, Any]:
|
|
272
|
+
_fold_body(kwargs)
|
|
255
273
|
body = {k: v for k, v in kwargs.items() if v is not None}
|
|
256
274
|
return self._request("POST", f"/api/v1/messages/{message_id}/reply", body)
|
|
257
275
|
|
|
258
276
|
def forward(self, message_id: str, **kwargs: Any) -> Dict[str, Any]:
|
|
277
|
+
_fold_body(kwargs)
|
|
259
278
|
body = {k: v for k, v in kwargs.items() if v is not None}
|
|
260
279
|
return self._request("POST", f"/api/v1/messages/{message_id}/forward", body)
|
|
261
280
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mailsai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Email API for AI agents — Python SDK. Per-agent email addresses on your domain, per-agent reputation, and prompt-injection scanning on every inbound. Send, receive structured inbound replies, and identify agents via REST. Intent + entity extraction is opt-in.
|
|
5
5
|
Author-email: "Mails.ai" <support@mails.ai>
|
|
6
6
|
License: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "mailsai"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.3"
|
|
8
8
|
description = "Email API for AI agents — Python SDK. Per-agent email addresses on your domain, per-agent reputation, and prompt-injection scanning on every inbound. Send, receive structured inbound replies, and identify agents via REST. Intent + entity extraction is opt-in."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|