agentex-sdk 0.7.0__py3-none-any.whl → 0.7.1__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.
agentex/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "agentex"
4
- __version__ = "0.7.0" # x-release-please-version
4
+ __version__ = "0.7.1" # x-release-please-version
@@ -15,7 +15,12 @@ from .batch import (
15
15
  BatchResourceWithStreamingResponse,
16
16
  AsyncBatchResourceWithStreamingResponse,
17
17
  )
18
- from ...types import message_list_params, message_create_params, message_update_params
18
+ from ...types import (
19
+ message_list_params,
20
+ message_create_params,
21
+ message_update_params,
22
+ message_list_paginated_params,
23
+ )
19
24
  from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
20
25
  from ..._utils import maybe_transform, async_maybe_transform
21
26
  from ..._compat import cached_property
@@ -30,6 +35,7 @@ from ..._base_client import make_request_options
30
35
  from ...types.task_message import TaskMessage
31
36
  from ...types.message_list_response import MessageListResponse
32
37
  from ...types.task_message_content_param import TaskMessageContentParam
38
+ from ...types.message_list_paginated_response import MessageListPaginatedResponse
33
39
 
34
40
  __all__ = ["MessagesResource", "AsyncMessagesResource"]
35
41
 
@@ -192,7 +198,10 @@ class MessagesResource(SyncAPIResource):
192
198
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
193
199
  ) -> MessageListResponse:
194
200
  """
195
- List Messages
201
+ List messages for a task with offset-based pagination.
202
+
203
+ For cursor-based pagination with infinite scroll support, use
204
+ /messages/paginated.
196
205
 
197
206
  Args:
198
207
  task_id: The task ID
@@ -226,6 +235,70 @@ class MessagesResource(SyncAPIResource):
226
235
  cast_to=MessageListResponse,
227
236
  )
228
237
 
238
+ def list_paginated(
239
+ self,
240
+ *,
241
+ task_id: str,
242
+ cursor: Optional[str] | Omit = omit,
243
+ direction: Literal["older", "newer"] | Omit = omit,
244
+ limit: int | Omit = omit,
245
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
246
+ # The extra values given here take precedence over values defined on the client or passed to this method.
247
+ extra_headers: Headers | None = None,
248
+ extra_query: Query | None = None,
249
+ extra_body: Body | None = None,
250
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
251
+ ) -> MessageListPaginatedResponse:
252
+ """
253
+ List messages for a task with cursor-based pagination.
254
+
255
+ This endpoint is designed for infinite scroll UIs where new messages may arrive
256
+ while paginating through older ones.
257
+
258
+ Args: task_id: The task ID to filter messages by limit: Maximum number of
259
+ messages to return (default: 50) cursor: Opaque cursor string for pagination.
260
+ Pass the `next_cursor` from a previous response to get the next page. direction:
261
+ Pagination direction - "older" to get older messages (default), "newer" to get
262
+ newer messages.
263
+
264
+ Returns: PaginatedMessagesResponse with: - data: List of messages (newest first
265
+ when direction="older") - next_cursor: Cursor for fetching the next page (null
266
+ if no more pages) - has_more: Whether there are more messages to fetch
267
+
268
+ Example: First request: GET /messages/paginated?task_id=xxx&limit=50 Next page:
269
+ GET /messages/paginated?task_id=xxx&limit=50&cursor=<next_cursor>
270
+
271
+ Args:
272
+ task_id: The task ID
273
+
274
+ extra_headers: Send extra headers
275
+
276
+ extra_query: Add additional query parameters to the request
277
+
278
+ extra_body: Add additional JSON properties to the request
279
+
280
+ timeout: Override the client-level default timeout for this request, in seconds
281
+ """
282
+ return self._get(
283
+ "/messages/paginated",
284
+ options=make_request_options(
285
+ extra_headers=extra_headers,
286
+ extra_query=extra_query,
287
+ extra_body=extra_body,
288
+ timeout=timeout,
289
+ query=maybe_transform(
290
+ {
291
+ "task_id": task_id,
292
+ "cursor": cursor,
293
+ "direction": direction,
294
+ "limit": limit,
295
+ },
296
+ message_list_paginated_params.MessageListPaginatedParams,
297
+ ),
298
+ ),
299
+ cast_to=MessageListPaginatedResponse,
300
+ )
301
+
229
302
 
230
303
  class AsyncMessagesResource(AsyncAPIResource):
231
304
  @cached_property
@@ -385,7 +458,10 @@ class AsyncMessagesResource(AsyncAPIResource):
385
458
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
386
459
  ) -> MessageListResponse:
387
460
  """
388
- List Messages
461
+ List messages for a task with offset-based pagination.
462
+
463
+ For cursor-based pagination with infinite scroll support, use
464
+ /messages/paginated.
389
465
 
390
466
  Args:
391
467
  task_id: The task ID
@@ -419,6 +495,70 @@ class AsyncMessagesResource(AsyncAPIResource):
419
495
  cast_to=MessageListResponse,
420
496
  )
421
497
 
498
+ async def list_paginated(
499
+ self,
500
+ *,
501
+ task_id: str,
502
+ cursor: Optional[str] | Omit = omit,
503
+ direction: Literal["older", "newer"] | Omit = omit,
504
+ limit: int | Omit = omit,
505
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
506
+ # The extra values given here take precedence over values defined on the client or passed to this method.
507
+ extra_headers: Headers | None = None,
508
+ extra_query: Query | None = None,
509
+ extra_body: Body | None = None,
510
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
511
+ ) -> MessageListPaginatedResponse:
512
+ """
513
+ List messages for a task with cursor-based pagination.
514
+
515
+ This endpoint is designed for infinite scroll UIs where new messages may arrive
516
+ while paginating through older ones.
517
+
518
+ Args: task_id: The task ID to filter messages by limit: Maximum number of
519
+ messages to return (default: 50) cursor: Opaque cursor string for pagination.
520
+ Pass the `next_cursor` from a previous response to get the next page. direction:
521
+ Pagination direction - "older" to get older messages (default), "newer" to get
522
+ newer messages.
523
+
524
+ Returns: PaginatedMessagesResponse with: - data: List of messages (newest first
525
+ when direction="older") - next_cursor: Cursor for fetching the next page (null
526
+ if no more pages) - has_more: Whether there are more messages to fetch
527
+
528
+ Example: First request: GET /messages/paginated?task_id=xxx&limit=50 Next page:
529
+ GET /messages/paginated?task_id=xxx&limit=50&cursor=<next_cursor>
530
+
531
+ Args:
532
+ task_id: The task ID
533
+
534
+ extra_headers: Send extra headers
535
+
536
+ extra_query: Add additional query parameters to the request
537
+
538
+ extra_body: Add additional JSON properties to the request
539
+
540
+ timeout: Override the client-level default timeout for this request, in seconds
541
+ """
542
+ return await self._get(
543
+ "/messages/paginated",
544
+ options=make_request_options(
545
+ extra_headers=extra_headers,
546
+ extra_query=extra_query,
547
+ extra_body=extra_body,
548
+ timeout=timeout,
549
+ query=await async_maybe_transform(
550
+ {
551
+ "task_id": task_id,
552
+ "cursor": cursor,
553
+ "direction": direction,
554
+ "limit": limit,
555
+ },
556
+ message_list_paginated_params.MessageListPaginatedParams,
557
+ ),
558
+ ),
559
+ cast_to=MessageListPaginatedResponse,
560
+ )
561
+
422
562
 
423
563
  class MessagesResourceWithRawResponse:
424
564
  def __init__(self, messages: MessagesResource) -> None:
@@ -436,6 +576,9 @@ class MessagesResourceWithRawResponse:
436
576
  self.list = to_raw_response_wrapper(
437
577
  messages.list,
438
578
  )
579
+ self.list_paginated = to_raw_response_wrapper(
580
+ messages.list_paginated,
581
+ )
439
582
 
440
583
  @cached_property
441
584
  def batch(self) -> BatchResourceWithRawResponse:
@@ -458,6 +601,9 @@ class AsyncMessagesResourceWithRawResponse:
458
601
  self.list = async_to_raw_response_wrapper(
459
602
  messages.list,
460
603
  )
604
+ self.list_paginated = async_to_raw_response_wrapper(
605
+ messages.list_paginated,
606
+ )
461
607
 
462
608
  @cached_property
463
609
  def batch(self) -> AsyncBatchResourceWithRawResponse:
@@ -480,6 +626,9 @@ class MessagesResourceWithStreamingResponse:
480
626
  self.list = to_streamed_response_wrapper(
481
627
  messages.list,
482
628
  )
629
+ self.list_paginated = to_streamed_response_wrapper(
630
+ messages.list_paginated,
631
+ )
483
632
 
484
633
  @cached_property
485
634
  def batch(self) -> BatchResourceWithStreamingResponse:
@@ -502,6 +651,9 @@ class AsyncMessagesResourceWithStreamingResponse:
502
651
  self.list = async_to_streamed_response_wrapper(
503
652
  messages.list,
504
653
  )
654
+ self.list_paginated = async_to_streamed_response_wrapper(
655
+ messages.list_paginated,
656
+ )
505
657
 
506
658
  @cached_property
507
659
  def batch(self) -> AsyncBatchResourceWithStreamingResponse:
agentex/types/__init__.py CHANGED
@@ -64,5 +64,7 @@ from .tool_request_content_param import ToolRequestContentParam as ToolRequestCo
64
64
  from .tool_response_content_param import ToolResponseContentParam as ToolResponseContentParam
65
65
  from .task_retrieve_by_name_params import TaskRetrieveByNameParams as TaskRetrieveByNameParams
66
66
  from .deployment_history_list_params import DeploymentHistoryListParams as DeploymentHistoryListParams
67
+ from .message_list_paginated_params import MessageListPaginatedParams as MessageListPaginatedParams
67
68
  from .task_retrieve_by_name_response import TaskRetrieveByNameResponse as TaskRetrieveByNameResponse
68
69
  from .deployment_history_list_response import DeploymentHistoryListResponse as DeploymentHistoryListResponse
70
+ from .message_list_paginated_response import MessageListPaginatedResponse as MessageListPaginatedResponse
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ __all__ = ["MessageListPaginatedParams"]
9
+
10
+
11
+ class MessageListPaginatedParams(TypedDict, total=False):
12
+ task_id: Required[str]
13
+ """The task ID"""
14
+
15
+ cursor: Optional[str]
16
+
17
+ direction: Literal["older", "newer"]
18
+
19
+ limit: int
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+
5
+ from .._models import BaseModel
6
+ from .task_message import TaskMessage
7
+
8
+ __all__ = ["MessageListPaginatedResponse"]
9
+
10
+
11
+ class MessageListPaginatedResponse(BaseModel):
12
+ """Response with cursor pagination metadata."""
13
+
14
+ data: List[TaskMessage]
15
+ """List of messages"""
16
+
17
+ has_more: Optional[bool] = None
18
+ """Whether there are more messages to fetch"""
19
+
20
+ next_cursor: Optional[str] = None
21
+ """Cursor for fetching the next page of older messages"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agentex-sdk
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: The official Python library for the agentex API
5
5
  Project-URL: Homepage, https://github.com/scaleapi/scale-agentex-python
6
6
  Project-URL: Repository, https://github.com/scaleapi/scale-agentex-python
@@ -11,7 +11,7 @@ agentex/_resource.py,sha256=S1t7wmR5WUvoDIhZjo_x-E7uoTJBynJ3d8tPJMQYdjw,1106
11
11
  agentex/_response.py,sha256=Tb9zazsnemO2rTxWtBjAD5WBqlhli5ZaXGbiKgdu5DE,28794
12
12
  agentex/_streaming.py,sha256=aOvLOte7kaclPGm-D0iNdM3uRcWrZ-T2B8t9BDNmpuA,10225
13
13
  agentex/_types.py,sha256=00q2kgDxUPJC16dU-YIUeOFsN5MzNW0zjzVXMlBYGV0,7296
14
- agentex/_version.py,sha256=hPeQtgytB3A7v7y2cNrZ9b5aUb3tRdUBraPY_Wg1Rig,159
14
+ agentex/_version.py,sha256=t63Lp-Z3w7p36sPMg2u_dX0Gm4PvvBY3HRChIRJXIgQ,159
15
15
  agentex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  agentex/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
17
  agentex/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
@@ -263,8 +263,8 @@ agentex/resources/tasks.py,sha256=PYclyozaR1az30ZcsEtP4WMvBoXPeF1mEvcNYOAWt0I,27
263
263
  agentex/resources/tracker.py,sha256=bxRuzI9ThHrZtJbZoctU9vodE1kxAqcdlwQVrcbQTb4,15089
264
264
  agentex/resources/messages/__init__.py,sha256=_J1eusFtr_k6zrAntJSuqx6LWEUBSTrV1OZZh7MaDPE,1015
265
265
  agentex/resources/messages/batch.py,sha256=bYDIf0ZF3-sTKnGfFmzFQUn8LMtMYoniY977J3zr8q8,9653
266
- agentex/resources/messages/messages.py,sha256=BNKPRle5TwVtYuLQPytFFoEMmQz5ObjJectU7ZUoseg,18470
267
- agentex/types/__init__.py,sha256=JEDsom9CZpig5AWGV5UH_JRQ7ewW7_q1DUP6TQnnioI,4519
266
+ agentex/resources/messages/messages.py,sha256=ae48_YXRBqPiwBkHavhZpJaFVhIL-MYng6Y8BUlnAYU,24756
267
+ agentex/types/__init__.py,sha256=zmdABr-KEqbFkBIZIqWgeWI-C9bSqCfJ-sm2OzBQFB0,4725
268
268
  agentex/types/acp_type.py,sha256=lEn_w4z-RIgyUVTQr8mm5l9OdFDQMDclbJU_lKa4Mi8,217
269
269
  agentex/types/agent.py,sha256=hwgmtylJYezzmGJbzbBQ7sn3oV2_bCZqgqlNq9WpZ0g,1318
270
270
  agentex/types/agent_list_params.py,sha256=s4heb3MQwMprmuol_smUDL2N0u-5WUbUCxt3J5Dqnag,515
@@ -285,6 +285,8 @@ agentex/types/event_list_params.py,sha256=Rrz0yo2w3gMTNYe3HQS9YCX1VktE_aaktuHezx
285
285
  agentex/types/event_list_response.py,sha256=rjUCkwS0pXnfqHEVPEKZdLIGJ14uXOrjatuOfR36s5s,254
286
286
  agentex/types/message_author.py,sha256=_IIVLAcZsLTG_vQWFpjWuxLIaHrc6wkv3q7qu5gam0o,218
287
287
  agentex/types/message_create_params.py,sha256=Vt7Hig0lI8qxWDpJ4JhjfjglSzptI2PjzbrOD1Qkmxk,502
288
+ agentex/types/message_list_paginated_params.py,sha256=FSlXXsrm7gZZP5-bnvNswo4EFuzlA3weHWakBSUDI6I,446
289
+ agentex/types/message_list_paginated_response.py,sha256=VRPr20UNkBRchJrkroujPT46d830qK1Z-G6h1ziSUS4,582
288
290
  agentex/types/message_list_params.py,sha256=dGhDWqZddCh5BIz-ebhQhwgiNEn8yujGjaVXdpHLbrc,427
289
291
  agentex/types/message_list_response.py,sha256=YYDf-57zLS-E1eX3EZxz7c6XCuBcRBws01_q2G7uk4Y,277
290
292
  agentex/types/message_style.py,sha256=nuoXzoDyP3KAQsQeKHaiby1EMxeY-8TJjWr8eMMpQEE,219
@@ -335,8 +337,8 @@ agentex/types/messages/batch_update_params.py,sha256=Ug5CThbD49a8j4qucg04OdmVrp_
335
337
  agentex/types/messages/batch_update_response.py,sha256=TbSBe6SuPzjXXWSj-nRjT1JHGBooTshHQQDa1AixQA8,278
336
338
  agentex/types/shared/__init__.py,sha256=IKs-Qn5Yja0kFh1G1kDqYZo43qrOu1hSoxlPdN-85dI,149
337
339
  agentex/types/shared/delete_response.py,sha256=8qH3zvQXaOHYQSHyXi7UQxdR4miTzR7V9K4zXVsiUyk,215
338
- agentex_sdk-0.7.0.dist-info/METADATA,sha256=8aDhuHqr6cjoSDQaWnBBk-2I7wgP0i11Y0M0d7rRlSw,15553
339
- agentex_sdk-0.7.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
340
- agentex_sdk-0.7.0.dist-info/entry_points.txt,sha256=V7vJuMZdF0UlvgX6KiBN7XUvq_cxF5kplcYvc1QlFaQ,62
341
- agentex_sdk-0.7.0.dist-info/licenses/LICENSE,sha256=Q1AOx2FtRcMlyMgQJ9eVN2WKPq2mQ33lnB4tvWxabLA,11337
342
- agentex_sdk-0.7.0.dist-info/RECORD,,
340
+ agentex_sdk-0.7.1.dist-info/METADATA,sha256=te0uU6OMYnh-QGBzUIHcL5izI4PS22QeLn8LbS87gqs,15553
341
+ agentex_sdk-0.7.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
342
+ agentex_sdk-0.7.1.dist-info/entry_points.txt,sha256=V7vJuMZdF0UlvgX6KiBN7XUvq_cxF5kplcYvc1QlFaQ,62
343
+ agentex_sdk-0.7.1.dist-info/licenses/LICENSE,sha256=Q1AOx2FtRcMlyMgQJ9eVN2WKPq2mQ33lnB4tvWxabLA,11337
344
+ agentex_sdk-0.7.1.dist-info/RECORD,,