aiinbx 0.187.0__py3-none-any.whl → 0.212.0__py3-none-any.whl
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.
- aiinbx/_types.py +3 -2
- aiinbx/_version.py +1 -1
- aiinbx/resources/threads.py +64 -0
- aiinbx/types/thread_search_params.py +16 -0
- aiinbx/types/unwrap_webhook_event.py +13 -9
- {aiinbx-0.187.0.dist-info → aiinbx-0.212.0.dist-info}/METADATA +3 -2
- {aiinbx-0.187.0.dist-info → aiinbx-0.212.0.dist-info}/RECORD +9 -9
- {aiinbx-0.187.0.dist-info → aiinbx-0.212.0.dist-info}/WHEEL +0 -0
- {aiinbx-0.187.0.dist-info → aiinbx-0.212.0.dist-info}/licenses/LICENSE +0 -0
aiinbx/_types.py
CHANGED
|
@@ -243,6 +243,9 @@ _T_co = TypeVar("_T_co", covariant=True)
|
|
|
243
243
|
if TYPE_CHECKING:
|
|
244
244
|
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
|
|
245
245
|
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
|
|
246
|
+
#
|
|
247
|
+
# Note: index() and count() methods are intentionally omitted to allow pyright to properly
|
|
248
|
+
# infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
|
|
246
249
|
class SequenceNotStr(Protocol[_T_co]):
|
|
247
250
|
@overload
|
|
248
251
|
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
|
|
@@ -251,8 +254,6 @@ if TYPE_CHECKING:
|
|
|
251
254
|
def __contains__(self, value: object, /) -> bool: ...
|
|
252
255
|
def __len__(self) -> int: ...
|
|
253
256
|
def __iter__(self) -> Iterator[_T_co]: ...
|
|
254
|
-
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
|
|
255
|
-
def count(self, value: Any, /) -> int: ...
|
|
256
257
|
def __reversed__(self) -> Iterator[_T_co]: ...
|
|
257
258
|
else:
|
|
258
259
|
# just point this to a normal `Sequence` at runtime to avoid having to special case
|
aiinbx/_version.py
CHANGED
aiinbx/resources/threads.py
CHANGED
|
@@ -185,6 +185,38 @@ class ThreadsResource(SyncAPIResource):
|
|
|
185
185
|
Search threads with various filtering options optimized for AI agents
|
|
186
186
|
|
|
187
187
|
Args:
|
|
188
|
+
conversation_state: Filter threads by conversation state
|
|
189
|
+
|
|
190
|
+
created_after: Filter threads created after this date
|
|
191
|
+
|
|
192
|
+
created_before: Filter threads created before this date
|
|
193
|
+
|
|
194
|
+
has_email_from_address: Filter threads with emails from this address
|
|
195
|
+
|
|
196
|
+
has_email_to_address: Filter threads with emails to this address
|
|
197
|
+
|
|
198
|
+
has_participant_emails: Filter threads that include all of these email addresses as participants
|
|
199
|
+
|
|
200
|
+
last_email_after: Filter threads with last email after this date
|
|
201
|
+
|
|
202
|
+
last_email_before: Filter threads with last email before this date
|
|
203
|
+
|
|
204
|
+
limit: Number of threads to return (1-100)
|
|
205
|
+
|
|
206
|
+
offset: Number of threads to skip
|
|
207
|
+
|
|
208
|
+
some_email_has_direction: Filter threads containing emails with this direction
|
|
209
|
+
|
|
210
|
+
some_email_has_status: Filter threads containing emails with this status
|
|
211
|
+
|
|
212
|
+
sort_by: Field to sort by
|
|
213
|
+
|
|
214
|
+
sort_order: Sort order
|
|
215
|
+
|
|
216
|
+
stale_threshold_days: Days to consider a thread stale (used with conversationState=stale)
|
|
217
|
+
|
|
218
|
+
subject_contains: Filter threads where subject contains this text
|
|
219
|
+
|
|
188
220
|
extra_headers: Send extra headers
|
|
189
221
|
|
|
190
222
|
extra_query: Add additional query parameters to the request
|
|
@@ -382,6 +414,38 @@ class AsyncThreadsResource(AsyncAPIResource):
|
|
|
382
414
|
Search threads with various filtering options optimized for AI agents
|
|
383
415
|
|
|
384
416
|
Args:
|
|
417
|
+
conversation_state: Filter threads by conversation state
|
|
418
|
+
|
|
419
|
+
created_after: Filter threads created after this date
|
|
420
|
+
|
|
421
|
+
created_before: Filter threads created before this date
|
|
422
|
+
|
|
423
|
+
has_email_from_address: Filter threads with emails from this address
|
|
424
|
+
|
|
425
|
+
has_email_to_address: Filter threads with emails to this address
|
|
426
|
+
|
|
427
|
+
has_participant_emails: Filter threads that include all of these email addresses as participants
|
|
428
|
+
|
|
429
|
+
last_email_after: Filter threads with last email after this date
|
|
430
|
+
|
|
431
|
+
last_email_before: Filter threads with last email before this date
|
|
432
|
+
|
|
433
|
+
limit: Number of threads to return (1-100)
|
|
434
|
+
|
|
435
|
+
offset: Number of threads to skip
|
|
436
|
+
|
|
437
|
+
some_email_has_direction: Filter threads containing emails with this direction
|
|
438
|
+
|
|
439
|
+
some_email_has_status: Filter threads containing emails with this status
|
|
440
|
+
|
|
441
|
+
sort_by: Field to sort by
|
|
442
|
+
|
|
443
|
+
sort_order: Sort order
|
|
444
|
+
|
|
445
|
+
stale_threshold_days: Days to consider a thread stale (used with conversationState=stale)
|
|
446
|
+
|
|
447
|
+
subject_contains: Filter threads where subject contains this text
|
|
448
|
+
|
|
385
449
|
extra_headers: Send extra headers
|
|
386
450
|
|
|
387
451
|
extra_query: Add additional query parameters to the request
|
|
@@ -14,26 +14,37 @@ class ThreadSearchParams(TypedDict, total=False):
|
|
|
14
14
|
conversation_state: Annotated[
|
|
15
15
|
Literal["awaiting_reply", "needs_reply", "active", "stale"], PropertyInfo(alias="conversationState")
|
|
16
16
|
]
|
|
17
|
+
"""Filter threads by conversation state"""
|
|
17
18
|
|
|
18
19
|
created_after: Annotated[str, PropertyInfo(alias="createdAfter")]
|
|
20
|
+
"""Filter threads created after this date"""
|
|
19
21
|
|
|
20
22
|
created_before: Annotated[str, PropertyInfo(alias="createdBefore")]
|
|
23
|
+
"""Filter threads created before this date"""
|
|
21
24
|
|
|
22
25
|
has_email_from_address: Annotated[str, PropertyInfo(alias="hasEmailFromAddress")]
|
|
26
|
+
"""Filter threads with emails from this address"""
|
|
23
27
|
|
|
24
28
|
has_email_to_address: Annotated[str, PropertyInfo(alias="hasEmailToAddress")]
|
|
29
|
+
"""Filter threads with emails to this address"""
|
|
25
30
|
|
|
26
31
|
has_participant_emails: Annotated[SequenceNotStr[str], PropertyInfo(alias="hasParticipantEmails")]
|
|
32
|
+
"""Filter threads that include all of these email addresses as participants"""
|
|
27
33
|
|
|
28
34
|
last_email_after: Annotated[str, PropertyInfo(alias="lastEmailAfter")]
|
|
35
|
+
"""Filter threads with last email after this date"""
|
|
29
36
|
|
|
30
37
|
last_email_before: Annotated[str, PropertyInfo(alias="lastEmailBefore")]
|
|
38
|
+
"""Filter threads with last email before this date"""
|
|
31
39
|
|
|
32
40
|
limit: float
|
|
41
|
+
"""Number of threads to return (1-100)"""
|
|
33
42
|
|
|
34
43
|
offset: float
|
|
44
|
+
"""Number of threads to skip"""
|
|
35
45
|
|
|
36
46
|
some_email_has_direction: Annotated[Literal["INBOUND", "OUTBOUND"], PropertyInfo(alias="someEmailHasDirection")]
|
|
47
|
+
"""Filter threads containing emails with this direction"""
|
|
37
48
|
|
|
38
49
|
some_email_has_status: Annotated[
|
|
39
50
|
Literal[
|
|
@@ -51,11 +62,16 @@ class ThreadSearchParams(TypedDict, total=False):
|
|
|
51
62
|
],
|
|
52
63
|
PropertyInfo(alias="someEmailHasStatus"),
|
|
53
64
|
]
|
|
65
|
+
"""Filter threads containing emails with this status"""
|
|
54
66
|
|
|
55
67
|
sort_by: Annotated[Literal["createdAt", "lastEmailAt", "subject"], PropertyInfo(alias="sortBy")]
|
|
68
|
+
"""Field to sort by"""
|
|
56
69
|
|
|
57
70
|
sort_order: Annotated[Literal["asc", "desc"], PropertyInfo(alias="sortOrder")]
|
|
71
|
+
"""Sort order"""
|
|
58
72
|
|
|
59
73
|
stale_threshold_days: Annotated[float, PropertyInfo(alias="staleThresholdDays")]
|
|
74
|
+
"""Days to consider a thread stale (used with conversationState=stale)"""
|
|
60
75
|
|
|
61
76
|
subject_contains: Annotated[str, PropertyInfo(alias="subjectContains")]
|
|
77
|
+
"""Filter threads where subject contains this text"""
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
from typing import Union
|
|
4
|
-
from typing_extensions import TypeAlias
|
|
4
|
+
from typing_extensions import Annotated, TypeAlias
|
|
5
5
|
|
|
6
|
+
from .._utils import PropertyInfo
|
|
6
7
|
from .outbound_email_opened_webhook_event import OutboundEmailOpenedWebhookEvent
|
|
7
8
|
from .inbound_email_received_webhook_event import InboundEmailReceivedWebhookEvent
|
|
8
9
|
from .outbound_email_bounced_webhook_event import OutboundEmailBouncedWebhookEvent
|
|
@@ -13,12 +14,15 @@ from .outbound_email_complained_webhook_event import OutboundEmailComplainedWebh
|
|
|
13
14
|
|
|
14
15
|
__all__ = ["UnwrapWebhookEvent"]
|
|
15
16
|
|
|
16
|
-
UnwrapWebhookEvent: TypeAlias =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
UnwrapWebhookEvent: TypeAlias = Annotated[
|
|
18
|
+
Union[
|
|
19
|
+
InboundEmailReceivedWebhookEvent,
|
|
20
|
+
OutboundEmailDeliveredWebhookEvent,
|
|
21
|
+
OutboundEmailBouncedWebhookEvent,
|
|
22
|
+
OutboundEmailComplainedWebhookEvent,
|
|
23
|
+
OutboundEmailRejectedWebhookEvent,
|
|
24
|
+
OutboundEmailOpenedWebhookEvent,
|
|
25
|
+
OutboundEmailClickedWebhookEvent,
|
|
26
|
+
],
|
|
27
|
+
PropertyInfo(discriminator="event"),
|
|
24
28
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: aiinbx
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.212.0
|
|
4
4
|
Summary: The official Python library for the AIInbx API
|
|
5
5
|
Project-URL: Homepage, https://github.com/aiinbx/aiinbx-py
|
|
6
6
|
Project-URL: Repository, https://github.com/aiinbx/aiinbx-py
|
|
@@ -114,6 +114,7 @@ pip install aiinbx[aiohttp]
|
|
|
114
114
|
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
115
115
|
|
|
116
116
|
```python
|
|
117
|
+
import os
|
|
117
118
|
import asyncio
|
|
118
119
|
from aiinbx import DefaultAioHttpClient
|
|
119
120
|
from aiinbx import AsyncAIInbx
|
|
@@ -121,7 +122,7 @@ from aiinbx import AsyncAIInbx
|
|
|
121
122
|
|
|
122
123
|
async def main() -> None:
|
|
123
124
|
async with AsyncAIInbx(
|
|
124
|
-
api_key="
|
|
125
|
+
api_key=os.environ.get("AI_INBX_API_KEY"), # This is the default and can be omitted
|
|
125
126
|
http_client=DefaultAioHttpClient(),
|
|
126
127
|
) as client:
|
|
127
128
|
response = await client.threads.search()
|
|
@@ -10,8 +10,8 @@ aiinbx/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
|
|
|
10
10
|
aiinbx/_resource.py,sha256=R_-4UEtw4XqdaVP9kNZE-XgrsuRBrQeFB0x4vbgWM_k,1100
|
|
11
11
|
aiinbx/_response.py,sha256=bN_uhJdOtEIu7WonnaRndk73_0N7bpUqEqUx_rZUxH8,28788
|
|
12
12
|
aiinbx/_streaming.py,sha256=7AWeXwBPMgZiPlU6Z5quvQqDqHDkkt9j38z5L0CBk50,10221
|
|
13
|
-
aiinbx/_types.py,sha256=
|
|
14
|
-
aiinbx/_version.py,sha256=
|
|
13
|
+
aiinbx/_types.py,sha256=LZpO7LB3Jw41PC06Kop69F0oo8jXulYKCOylxrlYkis,7295
|
|
14
|
+
aiinbx/_version.py,sha256=oz5UNoaNFRyb5xq5SmENHvvVG_PgpYCnk4KI8kjUYjU,160
|
|
15
15
|
aiinbx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
aiinbx/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
aiinbx/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -30,7 +30,7 @@ aiinbx/resources/__init__.py,sha256=A9igPOfiP9soOFOLpVfUBwR7looj88eofftT1jXV-jw,
|
|
|
30
30
|
aiinbx/resources/domains.py,sha256=xY9R9UNLwo72X8XOHEVs7bb7samZqHR4uBEyzUNw2z8,17548
|
|
31
31
|
aiinbx/resources/emails.py,sha256=5_FexN9HgTP27_HyfZJuhJswlYiUji_H2Xavgl5EeIs,17951
|
|
32
32
|
aiinbx/resources/meta.py,sha256=pG0ICZDnENRpvhVDPjoCZW509jhxgIpjhb8gG4hRusw,5464
|
|
33
|
-
aiinbx/resources/threads.py,sha256=
|
|
33
|
+
aiinbx/resources/threads.py,sha256=1lHa8_dBRtPLmEigVT9ksI2Ewiz67JW28rve6I7T_rU,21241
|
|
34
34
|
aiinbx/resources/webhooks.py,sha256=2aBYtHvVy4Ngpq_GEEMk0U6Vn_LKFwommXaguEjhhj0,962
|
|
35
35
|
aiinbx/types/__init__.py,sha256=Nax8UISh-wdV5r4vKVb8h1DXCgEhtidtyIjX0ZcBcnE,2424
|
|
36
36
|
aiinbx/types/domain_create_params.py,sha256=6VplEi2RZNbhYkfQ0E08gOYQ9nJyQvvOYu9yUsKfpq8,285
|
|
@@ -55,10 +55,10 @@ aiinbx/types/outbound_email_rejected_webhook_event.py,sha256=kmpVDzZvSPLaPktrySA
|
|
|
55
55
|
aiinbx/types/thread_forward_params.py,sha256=Ad9J1pcj-gXyHwvnDad_0z6mgn7sG26GHN97fkODCHE,1002
|
|
56
56
|
aiinbx/types/thread_forward_response.py,sha256=DmxnVB38C3R-fsNURfKMf5chNbKamQcx_QaubTk_8Ts,388
|
|
57
57
|
aiinbx/types/thread_retrieve_response.py,sha256=s5jj2iwBfcoVPeybIOJUVwRhvnc_0NdEMcbDGJnheEw,2364
|
|
58
|
-
aiinbx/types/thread_search_params.py,sha256=
|
|
58
|
+
aiinbx/types/thread_search_params.py,sha256=2dQdB7R9ri2wI9NZ-Ub1Dn2D_liodu3ZcngqquzZhTI,2780
|
|
59
59
|
aiinbx/types/thread_search_response.py,sha256=lldugJNQuQ5tsD9BrgxoDNojAYs7Ks8iZDMxwhnjogY,908
|
|
60
|
-
aiinbx/types/unwrap_webhook_event.py,sha256=
|
|
61
|
-
aiinbx-0.
|
|
62
|
-
aiinbx-0.
|
|
63
|
-
aiinbx-0.
|
|
64
|
-
aiinbx-0.
|
|
60
|
+
aiinbx/types/unwrap_webhook_event.py,sha256=70k2BARL8N22tVhpaFHOXknzr1hnCjKfTssZxY7HLF4,1227
|
|
61
|
+
aiinbx-0.212.0.dist-info/METADATA,sha256=QXrZbqPR5XQf0UjsZJ7jnXXE7Ox6YarsAaObHBQU24o,13282
|
|
62
|
+
aiinbx-0.212.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
63
|
+
aiinbx-0.212.0.dist-info/licenses/LICENSE,sha256=i1rY5G0rFWpuWXv5WPoFrQEOrDWycksLhJxuLBF1tZw,11337
|
|
64
|
+
aiinbx-0.212.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|