letta-client 1.0.0a9__py3-none-any.whl → 1.0.0a11__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.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

Files changed (63) hide show
  1. letta_client/_client.py +5 -1
  2. letta_client/_streaming.py +40 -2
  3. letta_client/_version.py +1 -1
  4. letta_client/resources/agents/agents.py +396 -396
  5. letta_client/resources/agents/blocks.py +198 -190
  6. letta_client/resources/agents/files.py +10 -13
  7. letta_client/resources/agents/folders.py +10 -13
  8. letta_client/resources/agents/messages.py +380 -370
  9. letta_client/resources/agents/tools.py +10 -13
  10. letta_client/resources/archives.py +111 -113
  11. letta_client/resources/batches/batches.py +10 -12
  12. letta_client/resources/batches/messages.py +11 -14
  13. letta_client/resources/blocks/blocks.py +238 -222
  14. letta_client/resources/folders/agents.py +10 -13
  15. letta_client/resources/folders/files.py +9 -12
  16. letta_client/resources/folders/folders.py +143 -145
  17. letta_client/resources/groups/groups.py +141 -141
  18. letta_client/resources/groups/messages.py +198 -198
  19. letta_client/resources/identities/blocks.py +7 -7
  20. letta_client/resources/identities/identities.py +151 -153
  21. letta_client/resources/runs/runs.py +11 -13
  22. letta_client/resources/tags.py +10 -13
  23. letta_client/resources/tools.py +802 -204
  24. letta_client/types/__init__.py +14 -7
  25. letta_client/types/{agent_update_params.py → agent_modify_params.py} +2 -2
  26. letta_client/types/agent_state.py +6 -3
  27. letta_client/types/agents/__init__.py +5 -3
  28. letta_client/types/agents/block.py +6 -3
  29. letta_client/types/agents/{block_update_params.py → block_modify_params.py} +8 -5
  30. letta_client/types/agents/file_list_response.py +14 -3
  31. letta_client/types/agents/folder_list_response.py +7 -3
  32. letta_client/types/agents/letta_streaming_response.py +70 -0
  33. letta_client/types/agents/{message_update_params.py → message_modify_params.py} +2 -2
  34. letta_client/types/agents/{message_update_response.py → message_modify_response.py} +2 -2
  35. letta_client/types/agents/tool_list_response.py +10 -0
  36. letta_client/types/archive_list_response.py +10 -0
  37. letta_client/types/{archive_update_params.py → archive_modify_params.py} +2 -2
  38. letta_client/types/batch_list_response.py +10 -0
  39. letta_client/types/batches/__init__.py +1 -0
  40. letta_client/types/batches/message_list_response.py +12 -0
  41. letta_client/types/block_create_params.py +6 -3
  42. letta_client/types/{block_update_params.py → block_modify_params.py} +8 -5
  43. letta_client/types/block_response.py +63 -0
  44. letta_client/types/create_block_param.py +6 -3
  45. letta_client/types/folder_list_response.py +10 -0
  46. letta_client/types/{folder_update_params.py → folder_modify_params.py} +2 -2
  47. letta_client/types/folders/agent_list_response.py +2 -1
  48. letta_client/types/folders/file_list_response.py +7 -4
  49. letta_client/types/{group_update_params.py → group_modify_params.py} +2 -2
  50. letta_client/types/groups/__init__.py +2 -2
  51. letta_client/types/groups/{message_update_params.py → message_modify_params.py} +2 -2
  52. letta_client/types/groups/{message_update_response.py → message_modify_response.py} +2 -2
  53. letta_client/types/identity_list_response.py +10 -0
  54. letta_client/types/{identity_update_params.py → identity_modify_params.py} +2 -2
  55. letta_client/types/run_list_response.py +10 -0
  56. letta_client/types/tag_list_response.py +2 -1
  57. letta_client/types/tool.py +106 -2
  58. letta_client/types/tool_list_response.py +10 -0
  59. letta_client/types/{tool_update_params.py → tool_modify_params.py} +2 -2
  60. {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/METADATA +1 -1
  61. {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/RECORD +63 -53
  62. {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/WHEEL +0 -0
  63. {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/licenses/LICENSE +0 -0
@@ -19,11 +19,11 @@ from ..._response import (
19
19
  )
20
20
  from ...pagination import SyncArrayPage, AsyncArrayPage
21
21
  from ..._base_client import AsyncPaginator, make_request_options
22
- from ...types.groups import message_list_params, message_send_params, message_stream_params, message_update_params
22
+ from ...types.groups import message_list_params, message_send_params, message_modify_params, message_stream_params
23
23
  from ...types.agents.message_type import MessageType
24
24
  from ...types.agents.letta_response import LettaResponse
25
25
  from ...types.agents.letta_message_union import LettaMessageUnion
26
- from ...types.groups.message_update_response import MessageUpdateResponse
26
+ from ...types.groups.message_modify_response import MessageModifyResponse
27
27
  from ...types.agents.letta_user_message_content_union_param import LettaUserMessageContentUnionParam
28
28
  from ...types.agents.letta_assistant_message_content_union_param import LettaAssistantMessageContentUnionParam
29
29
 
@@ -50,8 +50,87 @@ class MessagesResource(SyncAPIResource):
50
50
  """
51
51
  return MessagesResourceWithStreamingResponse(self)
52
52
 
53
+ def list(
54
+ self,
55
+ group_id: str,
56
+ *,
57
+ after: Optional[str] | Omit = omit,
58
+ assistant_message_tool_kwarg: str | Omit = omit,
59
+ assistant_message_tool_name: str | Omit = omit,
60
+ before: Optional[str] | Omit = omit,
61
+ limit: Optional[int] | Omit = omit,
62
+ order: Literal["asc", "desc"] | Omit = omit,
63
+ order_by: Literal["created_at"] | Omit = omit,
64
+ use_assistant_message: bool | Omit = omit,
65
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
66
+ # The extra values given here take precedence over values defined on the client or passed to this method.
67
+ extra_headers: Headers | None = None,
68
+ extra_query: Query | None = None,
69
+ extra_body: Body | None = None,
70
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
71
+ ) -> SyncArrayPage[LettaMessageUnion]:
72
+ """
73
+ Retrieve message history for an agent.
74
+
75
+ Args:
76
+ group_id: The ID of the group in the format 'group-<uuid4>'
77
+
78
+ after: Message ID cursor for pagination. Returns messages that come after this message
79
+ ID in the specified sort order
80
+
81
+ assistant_message_tool_kwarg: The name of the message argument.
82
+
83
+ assistant_message_tool_name: The name of the designated message tool.
84
+
85
+ before: Message ID cursor for pagination. Returns messages that come before this message
86
+ ID in the specified sort order
87
+
88
+ limit: Maximum number of messages to retrieve
89
+
90
+ order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
91
+ newest first
92
+
93
+ order_by: Field to sort by
94
+
95
+ use_assistant_message: Whether to use assistant messages
96
+
97
+ extra_headers: Send extra headers
98
+
99
+ extra_query: Add additional query parameters to the request
100
+
101
+ extra_body: Add additional JSON properties to the request
102
+
103
+ timeout: Override the client-level default timeout for this request, in seconds
104
+ """
105
+ if not group_id:
106
+ raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
107
+ return self._get_api_list(
108
+ f"/v1/groups/{group_id}/messages",
109
+ page=SyncArrayPage[LettaMessageUnion],
110
+ options=make_request_options(
111
+ extra_headers=extra_headers,
112
+ extra_query=extra_query,
113
+ extra_body=extra_body,
114
+ timeout=timeout,
115
+ query=maybe_transform(
116
+ {
117
+ "after": after,
118
+ "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
119
+ "assistant_message_tool_name": assistant_message_tool_name,
120
+ "before": before,
121
+ "limit": limit,
122
+ "order": order,
123
+ "order_by": order_by,
124
+ "use_assistant_message": use_assistant_message,
125
+ },
126
+ message_list_params.MessageListParams,
127
+ ),
128
+ ),
129
+ model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
130
+ )
131
+
53
132
  @overload
54
- def update(
133
+ def modify(
55
134
  self,
56
135
  message_id: str,
57
136
  *,
@@ -64,7 +143,7 @@ class MessagesResource(SyncAPIResource):
64
143
  extra_query: Query | None = None,
65
144
  extra_body: Body | None = None,
66
145
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
67
- ) -> MessageUpdateResponse:
146
+ ) -> MessageModifyResponse:
68
147
  """
69
148
  Update the details of a message associated with an agent.
70
149
 
@@ -87,7 +166,7 @@ class MessagesResource(SyncAPIResource):
87
166
  ...
88
167
 
89
168
  @overload
90
- def update(
169
+ def modify(
91
170
  self,
92
171
  message_id: str,
93
172
  *,
@@ -100,7 +179,7 @@ class MessagesResource(SyncAPIResource):
100
179
  extra_query: Query | None = None,
101
180
  extra_body: Body | None = None,
102
181
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
103
- ) -> MessageUpdateResponse:
182
+ ) -> MessageModifyResponse:
104
183
  """
105
184
  Update the details of a message associated with an agent.
106
185
 
@@ -123,7 +202,7 @@ class MessagesResource(SyncAPIResource):
123
202
  ...
124
203
 
125
204
  @overload
126
- def update(
205
+ def modify(
127
206
  self,
128
207
  message_id: str,
129
208
  *,
@@ -136,7 +215,7 @@ class MessagesResource(SyncAPIResource):
136
215
  extra_query: Query | None = None,
137
216
  extra_body: Body | None = None,
138
217
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
139
- ) -> MessageUpdateResponse:
218
+ ) -> MessageModifyResponse:
140
219
  """
141
220
  Update the details of a message associated with an agent.
142
221
 
@@ -156,7 +235,7 @@ class MessagesResource(SyncAPIResource):
156
235
  ...
157
236
 
158
237
  @overload
159
- def update(
238
+ def modify(
160
239
  self,
161
240
  message_id: str,
162
241
  *,
@@ -169,7 +248,7 @@ class MessagesResource(SyncAPIResource):
169
248
  extra_query: Query | None = None,
170
249
  extra_body: Body | None = None,
171
250
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
172
- ) -> MessageUpdateResponse:
251
+ ) -> MessageModifyResponse:
173
252
  """
174
253
  Update the details of a message associated with an agent.
175
254
 
@@ -192,7 +271,7 @@ class MessagesResource(SyncAPIResource):
192
271
  ...
193
272
 
194
273
  @required_args(["group_id", "content"], ["group_id", "reasoning"])
195
- def update(
274
+ def modify(
196
275
  self,
197
276
  message_id: str,
198
277
  *,
@@ -210,13 +289,13 @@ class MessagesResource(SyncAPIResource):
210
289
  extra_query: Query | None = None,
211
290
  extra_body: Body | None = None,
212
291
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
213
- ) -> MessageUpdateResponse:
292
+ ) -> MessageModifyResponse:
214
293
  if not group_id:
215
294
  raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
216
295
  if not message_id:
217
296
  raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}")
218
297
  return cast(
219
- MessageUpdateResponse,
298
+ MessageModifyResponse,
220
299
  self._patch(
221
300
  f"/v1/groups/{group_id}/messages/{message_id}",
222
301
  body=maybe_transform(
@@ -225,96 +304,17 @@ class MessagesResource(SyncAPIResource):
225
304
  "message_type": message_type,
226
305
  "reasoning": reasoning,
227
306
  },
228
- message_update_params.MessageUpdateParams,
307
+ message_modify_params.MessageModifyParams,
229
308
  ),
230
309
  options=make_request_options(
231
310
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
232
311
  ),
233
312
  cast_to=cast(
234
- Any, MessageUpdateResponse
313
+ Any, MessageModifyResponse
235
314
  ), # Union types cannot be passed in as arguments in the type system
236
315
  ),
237
316
  )
238
317
 
239
- def list(
240
- self,
241
- group_id: str,
242
- *,
243
- after: Optional[str] | Omit = omit,
244
- assistant_message_tool_kwarg: str | Omit = omit,
245
- assistant_message_tool_name: str | Omit = omit,
246
- before: Optional[str] | Omit = omit,
247
- limit: Optional[int] | Omit = omit,
248
- order: Literal["asc", "desc"] | Omit = omit,
249
- order_by: Literal["created_at"] | Omit = omit,
250
- use_assistant_message: bool | Omit = omit,
251
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
252
- # The extra values given here take precedence over values defined on the client or passed to this method.
253
- extra_headers: Headers | None = None,
254
- extra_query: Query | None = None,
255
- extra_body: Body | None = None,
256
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
257
- ) -> SyncArrayPage[LettaMessageUnion]:
258
- """
259
- Retrieve message history for an agent.
260
-
261
- Args:
262
- group_id: The ID of the group in the format 'group-<uuid4>'
263
-
264
- after: Message ID cursor for pagination. Returns messages that come after this message
265
- ID in the specified sort order
266
-
267
- assistant_message_tool_kwarg: The name of the message argument.
268
-
269
- assistant_message_tool_name: The name of the designated message tool.
270
-
271
- before: Message ID cursor for pagination. Returns messages that come before this message
272
- ID in the specified sort order
273
-
274
- limit: Maximum number of messages to retrieve
275
-
276
- order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
277
- newest first
278
-
279
- order_by: Field to sort by
280
-
281
- use_assistant_message: Whether to use assistant messages
282
-
283
- extra_headers: Send extra headers
284
-
285
- extra_query: Add additional query parameters to the request
286
-
287
- extra_body: Add additional JSON properties to the request
288
-
289
- timeout: Override the client-level default timeout for this request, in seconds
290
- """
291
- if not group_id:
292
- raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
293
- return self._get_api_list(
294
- f"/v1/groups/{group_id}/messages",
295
- page=SyncArrayPage[LettaMessageUnion],
296
- options=make_request_options(
297
- extra_headers=extra_headers,
298
- extra_query=extra_query,
299
- extra_body=extra_body,
300
- timeout=timeout,
301
- query=maybe_transform(
302
- {
303
- "after": after,
304
- "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
305
- "assistant_message_tool_name": assistant_message_tool_name,
306
- "before": before,
307
- "limit": limit,
308
- "order": order,
309
- "order_by": order_by,
310
- "use_assistant_message": use_assistant_message,
311
- },
312
- message_list_params.MessageListParams,
313
- ),
314
- ),
315
- model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
316
- )
317
-
318
318
  def reset(
319
319
  self,
320
320
  group_id: str,
@@ -538,8 +538,87 @@ class AsyncMessagesResource(AsyncAPIResource):
538
538
  """
539
539
  return AsyncMessagesResourceWithStreamingResponse(self)
540
540
 
541
+ def list(
542
+ self,
543
+ group_id: str,
544
+ *,
545
+ after: Optional[str] | Omit = omit,
546
+ assistant_message_tool_kwarg: str | Omit = omit,
547
+ assistant_message_tool_name: str | Omit = omit,
548
+ before: Optional[str] | Omit = omit,
549
+ limit: Optional[int] | Omit = omit,
550
+ order: Literal["asc", "desc"] | Omit = omit,
551
+ order_by: Literal["created_at"] | Omit = omit,
552
+ use_assistant_message: bool | Omit = omit,
553
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
554
+ # The extra values given here take precedence over values defined on the client or passed to this method.
555
+ extra_headers: Headers | None = None,
556
+ extra_query: Query | None = None,
557
+ extra_body: Body | None = None,
558
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
559
+ ) -> AsyncPaginator[LettaMessageUnion, AsyncArrayPage[LettaMessageUnion]]:
560
+ """
561
+ Retrieve message history for an agent.
562
+
563
+ Args:
564
+ group_id: The ID of the group in the format 'group-<uuid4>'
565
+
566
+ after: Message ID cursor for pagination. Returns messages that come after this message
567
+ ID in the specified sort order
568
+
569
+ assistant_message_tool_kwarg: The name of the message argument.
570
+
571
+ assistant_message_tool_name: The name of the designated message tool.
572
+
573
+ before: Message ID cursor for pagination. Returns messages that come before this message
574
+ ID in the specified sort order
575
+
576
+ limit: Maximum number of messages to retrieve
577
+
578
+ order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
579
+ newest first
580
+
581
+ order_by: Field to sort by
582
+
583
+ use_assistant_message: Whether to use assistant messages
584
+
585
+ extra_headers: Send extra headers
586
+
587
+ extra_query: Add additional query parameters to the request
588
+
589
+ extra_body: Add additional JSON properties to the request
590
+
591
+ timeout: Override the client-level default timeout for this request, in seconds
592
+ """
593
+ if not group_id:
594
+ raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
595
+ return self._get_api_list(
596
+ f"/v1/groups/{group_id}/messages",
597
+ page=AsyncArrayPage[LettaMessageUnion],
598
+ options=make_request_options(
599
+ extra_headers=extra_headers,
600
+ extra_query=extra_query,
601
+ extra_body=extra_body,
602
+ timeout=timeout,
603
+ query=maybe_transform(
604
+ {
605
+ "after": after,
606
+ "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
607
+ "assistant_message_tool_name": assistant_message_tool_name,
608
+ "before": before,
609
+ "limit": limit,
610
+ "order": order,
611
+ "order_by": order_by,
612
+ "use_assistant_message": use_assistant_message,
613
+ },
614
+ message_list_params.MessageListParams,
615
+ ),
616
+ ),
617
+ model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
618
+ )
619
+
541
620
  @overload
542
- async def update(
621
+ async def modify(
543
622
  self,
544
623
  message_id: str,
545
624
  *,
@@ -552,7 +631,7 @@ class AsyncMessagesResource(AsyncAPIResource):
552
631
  extra_query: Query | None = None,
553
632
  extra_body: Body | None = None,
554
633
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
555
- ) -> MessageUpdateResponse:
634
+ ) -> MessageModifyResponse:
556
635
  """
557
636
  Update the details of a message associated with an agent.
558
637
 
@@ -575,7 +654,7 @@ class AsyncMessagesResource(AsyncAPIResource):
575
654
  ...
576
655
 
577
656
  @overload
578
- async def update(
657
+ async def modify(
579
658
  self,
580
659
  message_id: str,
581
660
  *,
@@ -588,7 +667,7 @@ class AsyncMessagesResource(AsyncAPIResource):
588
667
  extra_query: Query | None = None,
589
668
  extra_body: Body | None = None,
590
669
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
591
- ) -> MessageUpdateResponse:
670
+ ) -> MessageModifyResponse:
592
671
  """
593
672
  Update the details of a message associated with an agent.
594
673
 
@@ -611,7 +690,7 @@ class AsyncMessagesResource(AsyncAPIResource):
611
690
  ...
612
691
 
613
692
  @overload
614
- async def update(
693
+ async def modify(
615
694
  self,
616
695
  message_id: str,
617
696
  *,
@@ -624,7 +703,7 @@ class AsyncMessagesResource(AsyncAPIResource):
624
703
  extra_query: Query | None = None,
625
704
  extra_body: Body | None = None,
626
705
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
627
- ) -> MessageUpdateResponse:
706
+ ) -> MessageModifyResponse:
628
707
  """
629
708
  Update the details of a message associated with an agent.
630
709
 
@@ -644,7 +723,7 @@ class AsyncMessagesResource(AsyncAPIResource):
644
723
  ...
645
724
 
646
725
  @overload
647
- async def update(
726
+ async def modify(
648
727
  self,
649
728
  message_id: str,
650
729
  *,
@@ -657,7 +736,7 @@ class AsyncMessagesResource(AsyncAPIResource):
657
736
  extra_query: Query | None = None,
658
737
  extra_body: Body | None = None,
659
738
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
660
- ) -> MessageUpdateResponse:
739
+ ) -> MessageModifyResponse:
661
740
  """
662
741
  Update the details of a message associated with an agent.
663
742
 
@@ -680,7 +759,7 @@ class AsyncMessagesResource(AsyncAPIResource):
680
759
  ...
681
760
 
682
761
  @required_args(["group_id", "content"], ["group_id", "reasoning"])
683
- async def update(
762
+ async def modify(
684
763
  self,
685
764
  message_id: str,
686
765
  *,
@@ -698,13 +777,13 @@ class AsyncMessagesResource(AsyncAPIResource):
698
777
  extra_query: Query | None = None,
699
778
  extra_body: Body | None = None,
700
779
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
701
- ) -> MessageUpdateResponse:
780
+ ) -> MessageModifyResponse:
702
781
  if not group_id:
703
782
  raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
704
783
  if not message_id:
705
784
  raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}")
706
785
  return cast(
707
- MessageUpdateResponse,
786
+ MessageModifyResponse,
708
787
  await self._patch(
709
788
  f"/v1/groups/{group_id}/messages/{message_id}",
710
789
  body=await async_maybe_transform(
@@ -713,96 +792,17 @@ class AsyncMessagesResource(AsyncAPIResource):
713
792
  "message_type": message_type,
714
793
  "reasoning": reasoning,
715
794
  },
716
- message_update_params.MessageUpdateParams,
795
+ message_modify_params.MessageModifyParams,
717
796
  ),
718
797
  options=make_request_options(
719
798
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
720
799
  ),
721
800
  cast_to=cast(
722
- Any, MessageUpdateResponse
801
+ Any, MessageModifyResponse
723
802
  ), # Union types cannot be passed in as arguments in the type system
724
803
  ),
725
804
  )
726
805
 
727
- def list(
728
- self,
729
- group_id: str,
730
- *,
731
- after: Optional[str] | Omit = omit,
732
- assistant_message_tool_kwarg: str | Omit = omit,
733
- assistant_message_tool_name: str | Omit = omit,
734
- before: Optional[str] | Omit = omit,
735
- limit: Optional[int] | Omit = omit,
736
- order: Literal["asc", "desc"] | Omit = omit,
737
- order_by: Literal["created_at"] | Omit = omit,
738
- use_assistant_message: bool | Omit = omit,
739
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
740
- # The extra values given here take precedence over values defined on the client or passed to this method.
741
- extra_headers: Headers | None = None,
742
- extra_query: Query | None = None,
743
- extra_body: Body | None = None,
744
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
745
- ) -> AsyncPaginator[LettaMessageUnion, AsyncArrayPage[LettaMessageUnion]]:
746
- """
747
- Retrieve message history for an agent.
748
-
749
- Args:
750
- group_id: The ID of the group in the format 'group-<uuid4>'
751
-
752
- after: Message ID cursor for pagination. Returns messages that come after this message
753
- ID in the specified sort order
754
-
755
- assistant_message_tool_kwarg: The name of the message argument.
756
-
757
- assistant_message_tool_name: The name of the designated message tool.
758
-
759
- before: Message ID cursor for pagination. Returns messages that come before this message
760
- ID in the specified sort order
761
-
762
- limit: Maximum number of messages to retrieve
763
-
764
- order: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
765
- newest first
766
-
767
- order_by: Field to sort by
768
-
769
- use_assistant_message: Whether to use assistant messages
770
-
771
- extra_headers: Send extra headers
772
-
773
- extra_query: Add additional query parameters to the request
774
-
775
- extra_body: Add additional JSON properties to the request
776
-
777
- timeout: Override the client-level default timeout for this request, in seconds
778
- """
779
- if not group_id:
780
- raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
781
- return self._get_api_list(
782
- f"/v1/groups/{group_id}/messages",
783
- page=AsyncArrayPage[LettaMessageUnion],
784
- options=make_request_options(
785
- extra_headers=extra_headers,
786
- extra_query=extra_query,
787
- extra_body=extra_body,
788
- timeout=timeout,
789
- query=maybe_transform(
790
- {
791
- "after": after,
792
- "assistant_message_tool_kwarg": assistant_message_tool_kwarg,
793
- "assistant_message_tool_name": assistant_message_tool_name,
794
- "before": before,
795
- "limit": limit,
796
- "order": order,
797
- "order_by": order_by,
798
- "use_assistant_message": use_assistant_message,
799
- },
800
- message_list_params.MessageListParams,
801
- ),
802
- ),
803
- model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
804
- )
805
-
806
806
  async def reset(
807
807
  self,
808
808
  group_id: str,
@@ -1010,12 +1010,12 @@ class MessagesResourceWithRawResponse:
1010
1010
  def __init__(self, messages: MessagesResource) -> None:
1011
1011
  self._messages = messages
1012
1012
 
1013
- self.update = to_raw_response_wrapper(
1014
- messages.update,
1015
- )
1016
1013
  self.list = to_raw_response_wrapper(
1017
1014
  messages.list,
1018
1015
  )
1016
+ self.modify = to_raw_response_wrapper(
1017
+ messages.modify,
1018
+ )
1019
1019
  self.reset = to_raw_response_wrapper(
1020
1020
  messages.reset,
1021
1021
  )
@@ -1031,12 +1031,12 @@ class AsyncMessagesResourceWithRawResponse:
1031
1031
  def __init__(self, messages: AsyncMessagesResource) -> None:
1032
1032
  self._messages = messages
1033
1033
 
1034
- self.update = async_to_raw_response_wrapper(
1035
- messages.update,
1036
- )
1037
1034
  self.list = async_to_raw_response_wrapper(
1038
1035
  messages.list,
1039
1036
  )
1037
+ self.modify = async_to_raw_response_wrapper(
1038
+ messages.modify,
1039
+ )
1040
1040
  self.reset = async_to_raw_response_wrapper(
1041
1041
  messages.reset,
1042
1042
  )
@@ -1052,12 +1052,12 @@ class MessagesResourceWithStreamingResponse:
1052
1052
  def __init__(self, messages: MessagesResource) -> None:
1053
1053
  self._messages = messages
1054
1054
 
1055
- self.update = to_streamed_response_wrapper(
1056
- messages.update,
1057
- )
1058
1055
  self.list = to_streamed_response_wrapper(
1059
1056
  messages.list,
1060
1057
  )
1058
+ self.modify = to_streamed_response_wrapper(
1059
+ messages.modify,
1060
+ )
1061
1061
  self.reset = to_streamed_response_wrapper(
1062
1062
  messages.reset,
1063
1063
  )
@@ -1073,12 +1073,12 @@ class AsyncMessagesResourceWithStreamingResponse:
1073
1073
  def __init__(self, messages: AsyncMessagesResource) -> None:
1074
1074
  self._messages = messages
1075
1075
 
1076
- self.update = async_to_streamed_response_wrapper(
1077
- messages.update,
1078
- )
1079
1076
  self.list = async_to_streamed_response_wrapper(
1080
1077
  messages.list,
1081
1078
  )
1079
+ self.modify = async_to_streamed_response_wrapper(
1080
+ messages.modify,
1081
+ )
1082
1082
  self.reset = async_to_streamed_response_wrapper(
1083
1083
  messages.reset,
1084
1084
  )
@@ -20,7 +20,7 @@ from ..._response import (
20
20
  from ...pagination import SyncArrayPage, AsyncArrayPage
21
21
  from ..._base_client import AsyncPaginator, make_request_options
22
22
  from ...types.identities import block_list_params
23
- from ...types.agents.block import Block
23
+ from ...types.block_response import BlockResponse
24
24
 
25
25
  __all__ = ["BlocksResource", "AsyncBlocksResource"]
26
26
 
@@ -60,7 +60,7 @@ class BlocksResource(SyncAPIResource):
60
60
  extra_query: Query | None = None,
61
61
  extra_body: Body | None = None,
62
62
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
63
- ) -> SyncArrayPage[Block]:
63
+ ) -> SyncArrayPage[BlockResponse]:
64
64
  """
65
65
  Get all blocks associated with the specified identity.
66
66
 
@@ -92,7 +92,7 @@ class BlocksResource(SyncAPIResource):
92
92
  raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
93
93
  return self._get_api_list(
94
94
  f"/v1/identities/{identity_id}/blocks",
95
- page=SyncArrayPage[Block],
95
+ page=SyncArrayPage[BlockResponse],
96
96
  options=make_request_options(
97
97
  extra_headers=extra_headers,
98
98
  extra_query=extra_query,
@@ -109,7 +109,7 @@ class BlocksResource(SyncAPIResource):
109
109
  block_list_params.BlockListParams,
110
110
  ),
111
111
  ),
112
- model=Block,
112
+ model=BlockResponse,
113
113
  )
114
114
 
115
115
 
@@ -148,7 +148,7 @@ class AsyncBlocksResource(AsyncAPIResource):
148
148
  extra_query: Query | None = None,
149
149
  extra_body: Body | None = None,
150
150
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
151
- ) -> AsyncPaginator[Block, AsyncArrayPage[Block]]:
151
+ ) -> AsyncPaginator[BlockResponse, AsyncArrayPage[BlockResponse]]:
152
152
  """
153
153
  Get all blocks associated with the specified identity.
154
154
 
@@ -180,7 +180,7 @@ class AsyncBlocksResource(AsyncAPIResource):
180
180
  raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
181
181
  return self._get_api_list(
182
182
  f"/v1/identities/{identity_id}/blocks",
183
- page=AsyncArrayPage[Block],
183
+ page=AsyncArrayPage[BlockResponse],
184
184
  options=make_request_options(
185
185
  extra_headers=extra_headers,
186
186
  extra_query=extra_query,
@@ -197,7 +197,7 @@ class AsyncBlocksResource(AsyncAPIResource):
197
197
  block_list_params.BlockListParams,
198
198
  ),
199
199
  ),
200
- model=Block,
200
+ model=BlockResponse,
201
201
  )
202
202
 
203
203