letta-client 0.1.295__py3-none-any.whl → 0.1.300__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 (44) hide show
  1. letta_client/__init__.py +12 -0
  2. letta_client/agents/__init__.py +2 -0
  3. letta_client/agents/client.py +100 -0
  4. letta_client/agents/messages/__init__.py +2 -0
  5. letta_client/agents/messages/client.py +17 -15
  6. letta_client/agents/messages/raw_client.py +23 -21
  7. letta_client/agents/messages/types/__init__.py +2 -0
  8. letta_client/agents/messages/types/letta_async_request_messages_item.py +8 -0
  9. letta_client/agents/messages/types/messages_modify_response.py +4 -0
  10. letta_client/agents/raw_client.py +122 -0
  11. letta_client/agents/tools/client.py +74 -0
  12. letta_client/agents/tools/raw_client.py +60 -0
  13. letta_client/client.py +45 -0
  14. letta_client/core/client_wrapper.py +2 -2
  15. letta_client/groups/messages/client.py +12 -11
  16. letta_client/groups/messages/raw_client.py +16 -15
  17. letta_client/groups/messages/types/messages_modify_response.py +4 -0
  18. letta_client/templates/client.py +20 -0
  19. letta_client/templates/raw_client.py +20 -0
  20. letta_client/tools/client.py +30 -0
  21. letta_client/tools/raw_client.py +30 -0
  22. letta_client/types/__init__.py +12 -0
  23. letta_client/types/approval_create.py +42 -0
  24. letta_client/types/approval_request_message.py +45 -0
  25. letta_client/types/approval_response_message.py +56 -0
  26. letta_client/types/letta_batch_request.py +2 -2
  27. letta_client/types/letta_batch_request_messages_item.py +8 -0
  28. letta_client/types/letta_message_union.py +4 -0
  29. letta_client/types/letta_request.py +2 -2
  30. letta_client/types/letta_request_messages_item.py +8 -0
  31. letta_client/types/letta_schemas_agent_file_message_schema.py +5 -0
  32. letta_client/types/letta_schemas_agent_file_tool_schema.py +5 -0
  33. letta_client/types/letta_streaming_request.py +3 -3
  34. letta_client/types/letta_streaming_request_messages_item.py +8 -0
  35. letta_client/types/message_create.py +5 -0
  36. letta_client/types/message_role.py +1 -1
  37. letta_client/types/message_type.py +2 -0
  38. letta_client/types/passage.py +5 -0
  39. letta_client/types/stop_reason_type.py +1 -0
  40. letta_client/types/tool.py +5 -0
  41. letta_client/types/tool_create.py +5 -0
  42. {letta_client-0.1.295.dist-info → letta_client-0.1.300.dist-info}/METADATA +1 -1
  43. {letta_client-0.1.295.dist-info → letta_client-0.1.300.dist-info}/RECORD +44 -37
  44. {letta_client-0.1.295.dist-info → letta_client-0.1.300.dist-info}/WHEEL +0 -0
@@ -981,6 +981,67 @@ class RawAgentsClient:
981
981
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
982
982
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
983
983
 
984
+ def modify_approval(
985
+ self,
986
+ agent_id: str,
987
+ tool_name: str,
988
+ *,
989
+ requires_approval: bool,
990
+ request_options: typing.Optional[RequestOptions] = None,
991
+ ) -> HttpResponse[AgentState]:
992
+ """
993
+ Attach a tool to an agent.
994
+
995
+ Parameters
996
+ ----------
997
+ agent_id : str
998
+
999
+ tool_name : str
1000
+
1001
+ requires_approval : bool
1002
+
1003
+ request_options : typing.Optional[RequestOptions]
1004
+ Request-specific configuration.
1005
+
1006
+ Returns
1007
+ -------
1008
+ HttpResponse[AgentState]
1009
+ Successful Response
1010
+ """
1011
+ _response = self._client_wrapper.httpx_client.request(
1012
+ f"v1/agents/{jsonable_encoder(agent_id)}/tools/approval/{jsonable_encoder(tool_name)}",
1013
+ method="PATCH",
1014
+ params={
1015
+ "requires_approval": requires_approval,
1016
+ },
1017
+ request_options=request_options,
1018
+ )
1019
+ try:
1020
+ if 200 <= _response.status_code < 300:
1021
+ _data = typing.cast(
1022
+ AgentState,
1023
+ construct_type(
1024
+ type_=AgentState, # type: ignore
1025
+ object_=_response.json(),
1026
+ ),
1027
+ )
1028
+ return HttpResponse(response=_response, data=_data)
1029
+ if _response.status_code == 422:
1030
+ raise UnprocessableEntityError(
1031
+ headers=dict(_response.headers),
1032
+ body=typing.cast(
1033
+ HttpValidationError,
1034
+ construct_type(
1035
+ type_=HttpValidationError, # type: ignore
1036
+ object_=_response.json(),
1037
+ ),
1038
+ ),
1039
+ )
1040
+ _response_json = _response.json()
1041
+ except JSONDecodeError:
1042
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1043
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1044
+
984
1045
  def list_agent_files(
985
1046
  self,
986
1047
  agent_id: str,
@@ -2124,6 +2185,67 @@ class AsyncRawAgentsClient:
2124
2185
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2125
2186
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2126
2187
 
2188
+ async def modify_approval(
2189
+ self,
2190
+ agent_id: str,
2191
+ tool_name: str,
2192
+ *,
2193
+ requires_approval: bool,
2194
+ request_options: typing.Optional[RequestOptions] = None,
2195
+ ) -> AsyncHttpResponse[AgentState]:
2196
+ """
2197
+ Attach a tool to an agent.
2198
+
2199
+ Parameters
2200
+ ----------
2201
+ agent_id : str
2202
+
2203
+ tool_name : str
2204
+
2205
+ requires_approval : bool
2206
+
2207
+ request_options : typing.Optional[RequestOptions]
2208
+ Request-specific configuration.
2209
+
2210
+ Returns
2211
+ -------
2212
+ AsyncHttpResponse[AgentState]
2213
+ Successful Response
2214
+ """
2215
+ _response = await self._client_wrapper.httpx_client.request(
2216
+ f"v1/agents/{jsonable_encoder(agent_id)}/tools/approval/{jsonable_encoder(tool_name)}",
2217
+ method="PATCH",
2218
+ params={
2219
+ "requires_approval": requires_approval,
2220
+ },
2221
+ request_options=request_options,
2222
+ )
2223
+ try:
2224
+ if 200 <= _response.status_code < 300:
2225
+ _data = typing.cast(
2226
+ AgentState,
2227
+ construct_type(
2228
+ type_=AgentState, # type: ignore
2229
+ object_=_response.json(),
2230
+ ),
2231
+ )
2232
+ return AsyncHttpResponse(response=_response, data=_data)
2233
+ if _response.status_code == 422:
2234
+ raise UnprocessableEntityError(
2235
+ headers=dict(_response.headers),
2236
+ body=typing.cast(
2237
+ HttpValidationError,
2238
+ construct_type(
2239
+ type_=HttpValidationError, # type: ignore
2240
+ object_=_response.json(),
2241
+ ),
2242
+ ),
2243
+ )
2244
+ _response_json = _response.json()
2245
+ except JSONDecodeError:
2246
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2247
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2248
+
2127
2249
  async def list_agent_files(
2128
2250
  self,
2129
2251
  agent_id: str,
@@ -127,6 +127,39 @@ class ToolsClient:
127
127
  _response = self._raw_client.detach(agent_id, tool_id, request_options=request_options)
128
128
  return _response.data
129
129
 
130
+ def modify_approval(
131
+ self, agent_id: str, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
132
+ ) -> None:
133
+ """
134
+ Parameters
135
+ ----------
136
+ agent_id : str
137
+
138
+ tool_id : str
139
+
140
+ request_options : typing.Optional[RequestOptions]
141
+ Request-specific configuration.
142
+
143
+ Returns
144
+ -------
145
+ None
146
+
147
+ Examples
148
+ --------
149
+ from letta_client import Letta
150
+
151
+ client = Letta(
152
+ project="YOUR_PROJECT",
153
+ token="YOUR_TOKEN",
154
+ )
155
+ client.agents.tools.modify_approval(
156
+ agent_id="agent_id",
157
+ tool_id="tool_id",
158
+ )
159
+ """
160
+ _response = self._raw_client.modify_approval(agent_id, tool_id, request_options=request_options)
161
+ return _response.data
162
+
130
163
 
131
164
  class AsyncToolsClient:
132
165
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -271,3 +304,44 @@ class AsyncToolsClient:
271
304
  """
272
305
  _response = await self._raw_client.detach(agent_id, tool_id, request_options=request_options)
273
306
  return _response.data
307
+
308
+ async def modify_approval(
309
+ self, agent_id: str, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
310
+ ) -> None:
311
+ """
312
+ Parameters
313
+ ----------
314
+ agent_id : str
315
+
316
+ tool_id : str
317
+
318
+ request_options : typing.Optional[RequestOptions]
319
+ Request-specific configuration.
320
+
321
+ Returns
322
+ -------
323
+ None
324
+
325
+ Examples
326
+ --------
327
+ import asyncio
328
+
329
+ from letta_client import AsyncLetta
330
+
331
+ client = AsyncLetta(
332
+ project="YOUR_PROJECT",
333
+ token="YOUR_TOKEN",
334
+ )
335
+
336
+
337
+ async def main() -> None:
338
+ await client.agents.tools.modify_approval(
339
+ agent_id="agent_id",
340
+ tool_id="tool_id",
341
+ )
342
+
343
+
344
+ asyncio.run(main())
345
+ """
346
+ _response = await self._raw_client.modify_approval(agent_id, tool_id, request_options=request_options)
347
+ return _response.data
@@ -170,6 +170,36 @@ class RawToolsClient:
170
170
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
171
171
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
172
172
 
173
+ def modify_approval(
174
+ self, agent_id: str, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
175
+ ) -> HttpResponse[None]:
176
+ """
177
+ Parameters
178
+ ----------
179
+ agent_id : str
180
+
181
+ tool_id : str
182
+
183
+ request_options : typing.Optional[RequestOptions]
184
+ Request-specific configuration.
185
+
186
+ Returns
187
+ -------
188
+ HttpResponse[None]
189
+ """
190
+ _response = self._client_wrapper.httpx_client.request(
191
+ f"v1/agents/{jsonable_encoder(agent_id)}/tools/approval/{jsonable_encoder(tool_id)}",
192
+ method="PATCH",
193
+ request_options=request_options,
194
+ )
195
+ try:
196
+ if 200 <= _response.status_code < 300:
197
+ return HttpResponse(response=_response, data=None)
198
+ _response_json = _response.json()
199
+ except JSONDecodeError:
200
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
201
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
202
+
173
203
 
174
204
  class AsyncRawToolsClient:
175
205
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -325,3 +355,33 @@ class AsyncRawToolsClient:
325
355
  except JSONDecodeError:
326
356
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
327
357
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
358
+
359
+ async def modify_approval(
360
+ self, agent_id: str, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None
361
+ ) -> AsyncHttpResponse[None]:
362
+ """
363
+ Parameters
364
+ ----------
365
+ agent_id : str
366
+
367
+ tool_id : str
368
+
369
+ request_options : typing.Optional[RequestOptions]
370
+ Request-specific configuration.
371
+
372
+ Returns
373
+ -------
374
+ AsyncHttpResponse[None]
375
+ """
376
+ _response = await self._client_wrapper.httpx_client.request(
377
+ f"v1/agents/{jsonable_encoder(agent_id)}/tools/approval/{jsonable_encoder(tool_id)}",
378
+ method="PATCH",
379
+ request_options=request_options,
380
+ )
381
+ try:
382
+ if 200 <= _response.status_code < 300:
383
+ return AsyncHttpResponse(response=_response, data=None)
384
+ _response_json = _response.json()
385
+ except JSONDecodeError:
386
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
387
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
letta_client/client.py CHANGED
@@ -8,6 +8,7 @@ from .base_client import AsyncLettaBase, LettaBase
8
8
  from .core.request_options import RequestOptions
9
9
  from .tools.client import ToolsClient as ToolsClientBase
10
10
  from .tools.client import AsyncToolsClient as AsyncToolsClientBase
11
+ from .types.npm_requirement import NpmRequirement
11
12
  from .types.pip_requirement import PipRequirement
12
13
  from .types.tool import Tool
13
14
 
@@ -144,6 +145,8 @@ class ToolsClient(ToolsClientBase):
144
145
  ] = OMIT,
145
146
  return_char_limit: typing.Optional[int] = OMIT,
146
147
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
148
+ npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
149
+ default_requires_approval: typing.Optional[bool] = OMIT,
147
150
  request_options: typing.Optional[RequestOptions] = None,
148
151
  ) -> Tool:
149
152
  """
@@ -175,6 +178,12 @@ class ToolsClient(ToolsClientBase):
175
178
  pip_requirements : typing.Optional[typing.Sequence[PipRequirement]]
176
179
  Optional list of pip packages required by this tool.
177
180
 
181
+ npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
182
+ Optional list of npm packages required by this tool.
183
+
184
+ default_requires_approval : typing.Optional[bool]
185
+ Whether or not to require approval before executing this tool.
186
+
178
187
  request_options : typing.Optional[RequestOptions]
179
188
  Request-specific configuration.
180
189
 
@@ -221,6 +230,8 @@ class ToolsClient(ToolsClientBase):
221
230
  json_schema=json_schema,
222
231
  return_char_limit=return_char_limit,
223
232
  pip_requirements=pip_requirements,
233
+ npm_requirements=npm_requirements,
234
+ default_requires_approval=default_requires_approval,
224
235
  request_options=request_options,
225
236
  )
226
237
 
@@ -238,6 +249,8 @@ class ToolsClient(ToolsClientBase):
238
249
  ] = OMIT,
239
250
  return_char_limit: typing.Optional[int] = OMIT,
240
251
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
252
+ npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
253
+ default_requires_approval: typing.Optional[bool] = OMIT,
241
254
  request_options: typing.Optional[RequestOptions] = None,
242
255
  ) -> Tool:
243
256
  """
@@ -269,6 +282,12 @@ class ToolsClient(ToolsClientBase):
269
282
  pip_requirements : typing.Optional[typing.Sequence[PipRequirement]]
270
283
  Optional list of pip packages required by this tool.
271
284
 
285
+ npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
286
+ Optional list of npm packages required by this tool.
287
+
288
+ default_requires_approval : typing.Optional[bool]
289
+ Whether or not to require approval before executing this tool.
290
+
272
291
  request_options : typing.Optional[RequestOptions]
273
292
  Request-specific configuration.
274
293
 
@@ -315,6 +334,8 @@ class ToolsClient(ToolsClientBase):
315
334
  json_schema=json_schema,
316
335
  return_char_limit=return_char_limit,
317
336
  pip_requirements=pip_requirements,
337
+ npm_requirements=npm_requirements,
338
+ default_requires_approval=default_requires_approval,
318
339
  request_options=request_options,
319
340
  )
320
341
 
@@ -391,6 +412,8 @@ class ToolsClient(ToolsClientBase):
391
412
  json_schema=tool.json_schema or OMIT,
392
413
  return_char_limit=tool.return_char_limit or OMIT,
393
414
  pip_requirements=tool.pip_requirements or OMIT,
415
+ npm_requirements=tool.npm_requirements or OMIT,
416
+ default_requires_approval=tool.default_requires_approval or OMIT,
394
417
  request_options=request_options,
395
418
  )
396
419
 
@@ -410,6 +433,8 @@ class AsyncToolsClient(AsyncToolsClientBase):
410
433
  ] = OMIT,
411
434
  return_char_limit: typing.Optional[int] = OMIT,
412
435
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
436
+ npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
437
+ default_requires_approval: typing.Optional[bool] = OMIT,
413
438
  request_options: typing.Optional[RequestOptions] = None,
414
439
  ) -> Tool:
415
440
  """
@@ -441,6 +466,12 @@ class AsyncToolsClient(AsyncToolsClientBase):
441
466
  pip_requirements : typing.Optional[typing.Sequence[PipRequirement]]
442
467
  Optional list of pip packages required by this tool.
443
468
 
469
+ npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
470
+ Optional list of npm packages required by this tool.
471
+
472
+ default_requires_approval : typing.Optional[bool]
473
+ Whether or not to require approval before executing this tool.
474
+
444
475
  request_options : typing.Optional[RequestOptions]
445
476
  Request-specific configuration.
446
477
 
@@ -487,6 +518,8 @@ class AsyncToolsClient(AsyncToolsClientBase):
487
518
  json_schema=json_schema,
488
519
  return_char_limit=return_char_limit,
489
520
  pip_requirements=pip_requirements,
521
+ npm_requirements=npm_requirements,
522
+ default_requires_approval=default_requires_approval,
490
523
  request_options=request_options,
491
524
  )
492
525
 
@@ -504,6 +537,8 @@ class AsyncToolsClient(AsyncToolsClientBase):
504
537
  ] = OMIT,
505
538
  return_char_limit: typing.Optional[int] = OMIT,
506
539
  pip_requirements: typing.Optional[typing.Sequence[PipRequirement]] = OMIT,
540
+ npm_requirements: typing.Optional[typing.Sequence[NpmRequirement]] = OMIT,
541
+ default_requires_approval: typing.Optional[bool] = OMIT,
507
542
  request_options: typing.Optional[RequestOptions] = None,
508
543
  ) -> Tool:
509
544
  """
@@ -535,6 +570,12 @@ class AsyncToolsClient(AsyncToolsClientBase):
535
570
  pip_requirements : typing.Optional[typing.Sequence[PipRequirement]]
536
571
  Optional list of pip packages required by this tool.
537
572
 
573
+ npm_requirements : typing.Optional[typing.Sequence[NpmRequirement]]
574
+ Optional list of npm packages required by this tool.
575
+
576
+ default_requires_approval : typing.Optional[bool]
577
+ Whether or not to require approval before executing this tool.
578
+
538
579
  request_options : typing.Optional[RequestOptions]
539
580
  Request-specific configuration.
540
581
 
@@ -581,6 +622,8 @@ class AsyncToolsClient(AsyncToolsClientBase):
581
622
  json_schema=json_schema,
582
623
  return_char_limit=return_char_limit,
583
624
  pip_requirements=pip_requirements,
625
+ npm_requirements=npm_requirements,
626
+ default_requires_approval=default_requires_approval,
584
627
  request_options=request_options,
585
628
  )
586
629
 
@@ -657,5 +700,7 @@ class AsyncToolsClient(AsyncToolsClientBase):
657
700
  json_schema=tool.json_schema or OMIT,
658
701
  return_char_limit=tool.return_char_limit or OMIT,
659
702
  pip_requirements=tool.pip_requirements or OMIT,
703
+ npm_requirements=tool.npm_requirements or OMIT,
704
+ default_requires_approval=tool.default_requires_approval or OMIT,
660
705
  request_options=request_options,
661
706
  )
@@ -24,10 +24,10 @@ class BaseClientWrapper:
24
24
 
25
25
  def get_headers(self) -> typing.Dict[str, str]:
26
26
  headers: typing.Dict[str, str] = {
27
- "User-Agent": "letta-client/0.1.295",
27
+ "User-Agent": "letta-client/0.1.300",
28
28
  "X-Fern-Language": "Python",
29
29
  "X-Fern-SDK-Name": "letta-client",
30
- "X-Fern-SDK-Version": "0.1.295",
30
+ "X-Fern-SDK-Version": "0.1.300",
31
31
  **(self.get_custom_headers() or {}),
32
32
  }
33
33
  if self._project is not None:
@@ -5,8 +5,9 @@ import typing
5
5
  from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ...core.request_options import RequestOptions
7
7
  from ...types.letta_message_union import LettaMessageUnion
8
+ from ...types.letta_request_messages_item import LettaRequestMessagesItem
8
9
  from ...types.letta_response import LettaResponse
9
- from ...types.message_create import MessageCreate
10
+ from ...types.letta_streaming_request_messages_item import LettaStreamingRequestMessagesItem
10
11
  from ...types.message_type import MessageType
11
12
  from .raw_client import AsyncRawMessagesClient, RawMessagesClient
12
13
  from .types.letta_streaming_response import LettaStreamingResponse
@@ -105,7 +106,7 @@ class MessagesClient:
105
106
  self,
106
107
  group_id: str,
107
108
  *,
108
- messages: typing.Sequence[MessageCreate],
109
+ messages: typing.Sequence[LettaRequestMessagesItem],
109
110
  max_steps: typing.Optional[int] = OMIT,
110
111
  use_assistant_message: typing.Optional[bool] = OMIT,
111
112
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -122,7 +123,7 @@ class MessagesClient:
122
123
  ----------
123
124
  group_id : str
124
125
 
125
- messages : typing.Sequence[MessageCreate]
126
+ messages : typing.Sequence[LettaRequestMessagesItem]
126
127
  The messages to be sent to the agent.
127
128
 
128
129
  max_steps : typing.Optional[int]
@@ -190,7 +191,7 @@ class MessagesClient:
190
191
  self,
191
192
  group_id: str,
192
193
  *,
193
- messages: typing.Sequence[MessageCreate],
194
+ messages: typing.Sequence[LettaStreamingRequestMessagesItem],
194
195
  max_steps: typing.Optional[int] = OMIT,
195
196
  use_assistant_message: typing.Optional[bool] = OMIT,
196
197
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -211,7 +212,7 @@ class MessagesClient:
211
212
  ----------
212
213
  group_id : str
213
214
 
214
- messages : typing.Sequence[MessageCreate]
215
+ messages : typing.Sequence[LettaStreamingRequestMessagesItem]
215
216
  The messages to be sent to the agent.
216
217
 
217
218
  max_steps : typing.Optional[int]
@@ -233,7 +234,7 @@ class MessagesClient:
233
234
  If set to True, enables reasoning before responses or tool calls from the agent.
234
235
 
235
236
  stream_tokens : typing.Optional[bool]
236
- Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
237
+ Flag to determine if individual tokens should be streamed, rather than streaming per step.
237
238
 
238
239
  include_pings : typing.Optional[bool]
239
240
  Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts.
@@ -465,7 +466,7 @@ class AsyncMessagesClient:
465
466
  self,
466
467
  group_id: str,
467
468
  *,
468
- messages: typing.Sequence[MessageCreate],
469
+ messages: typing.Sequence[LettaRequestMessagesItem],
469
470
  max_steps: typing.Optional[int] = OMIT,
470
471
  use_assistant_message: typing.Optional[bool] = OMIT,
471
472
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -482,7 +483,7 @@ class AsyncMessagesClient:
482
483
  ----------
483
484
  group_id : str
484
485
 
485
- messages : typing.Sequence[MessageCreate]
486
+ messages : typing.Sequence[LettaRequestMessagesItem]
486
487
  The messages to be sent to the agent.
487
488
 
488
489
  max_steps : typing.Optional[int]
@@ -558,7 +559,7 @@ class AsyncMessagesClient:
558
559
  self,
559
560
  group_id: str,
560
561
  *,
561
- messages: typing.Sequence[MessageCreate],
562
+ messages: typing.Sequence[LettaStreamingRequestMessagesItem],
562
563
  max_steps: typing.Optional[int] = OMIT,
563
564
  use_assistant_message: typing.Optional[bool] = OMIT,
564
565
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -579,7 +580,7 @@ class AsyncMessagesClient:
579
580
  ----------
580
581
  group_id : str
581
582
 
582
- messages : typing.Sequence[MessageCreate]
583
+ messages : typing.Sequence[LettaStreamingRequestMessagesItem]
583
584
  The messages to be sent to the agent.
584
585
 
585
586
  max_steps : typing.Optional[int]
@@ -601,7 +602,7 @@ class AsyncMessagesClient:
601
602
  If set to True, enables reasoning before responses or tool calls from the agent.
602
603
 
603
604
  stream_tokens : typing.Optional[bool]
604
- Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
605
+ Flag to determine if individual tokens should be streamed, rather than streaming per step.
605
606
 
606
607
  include_pings : typing.Optional[bool]
607
608
  Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts.
@@ -16,8 +16,9 @@ from ...core.unchecked_base_model import construct_type
16
16
  from ...errors.unprocessable_entity_error import UnprocessableEntityError
17
17
  from ...types.http_validation_error import HttpValidationError
18
18
  from ...types.letta_message_union import LettaMessageUnion
19
+ from ...types.letta_request_messages_item import LettaRequestMessagesItem
19
20
  from ...types.letta_response import LettaResponse
20
- from ...types.message_create import MessageCreate
21
+ from ...types.letta_streaming_request_messages_item import LettaStreamingRequestMessagesItem
21
22
  from ...types.message_type import MessageType
22
23
  from .types.letta_streaming_response import LettaStreamingResponse
23
24
  from .types.messages_modify_request import MessagesModifyRequest
@@ -119,7 +120,7 @@ class RawMessagesClient:
119
120
  self,
120
121
  group_id: str,
121
122
  *,
122
- messages: typing.Sequence[MessageCreate],
123
+ messages: typing.Sequence[LettaRequestMessagesItem],
123
124
  max_steps: typing.Optional[int] = OMIT,
124
125
  use_assistant_message: typing.Optional[bool] = OMIT,
125
126
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -136,7 +137,7 @@ class RawMessagesClient:
136
137
  ----------
137
138
  group_id : str
138
139
 
139
- messages : typing.Sequence[MessageCreate]
140
+ messages : typing.Sequence[LettaRequestMessagesItem]
140
141
  The messages to be sent to the agent.
141
142
 
142
143
  max_steps : typing.Optional[int]
@@ -170,7 +171,7 @@ class RawMessagesClient:
170
171
  method="POST",
171
172
  json={
172
173
  "messages": convert_and_respect_annotation_metadata(
173
- object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
174
+ object_=messages, annotation=typing.Sequence[LettaRequestMessagesItem], direction="write"
174
175
  ),
175
176
  "max_steps": max_steps,
176
177
  "use_assistant_message": use_assistant_message,
@@ -216,7 +217,7 @@ class RawMessagesClient:
216
217
  self,
217
218
  group_id: str,
218
219
  *,
219
- messages: typing.Sequence[MessageCreate],
220
+ messages: typing.Sequence[LettaStreamingRequestMessagesItem],
220
221
  max_steps: typing.Optional[int] = OMIT,
221
222
  use_assistant_message: typing.Optional[bool] = OMIT,
222
223
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -237,7 +238,7 @@ class RawMessagesClient:
237
238
  ----------
238
239
  group_id : str
239
240
 
240
- messages : typing.Sequence[MessageCreate]
241
+ messages : typing.Sequence[LettaStreamingRequestMessagesItem]
241
242
  The messages to be sent to the agent.
242
243
 
243
244
  max_steps : typing.Optional[int]
@@ -259,7 +260,7 @@ class RawMessagesClient:
259
260
  If set to True, enables reasoning before responses or tool calls from the agent.
260
261
 
261
262
  stream_tokens : typing.Optional[bool]
262
- Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
263
+ Flag to determine if individual tokens should be streamed, rather than streaming per step.
263
264
 
264
265
  include_pings : typing.Optional[bool]
265
266
  Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts.
@@ -280,7 +281,7 @@ class RawMessagesClient:
280
281
  method="POST",
281
282
  json={
282
283
  "messages": convert_and_respect_annotation_metadata(
283
- object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
284
+ object_=messages, annotation=typing.Sequence[LettaStreamingRequestMessagesItem], direction="write"
284
285
  ),
285
286
  "max_steps": max_steps,
286
287
  "use_assistant_message": use_assistant_message,
@@ -551,7 +552,7 @@ class AsyncRawMessagesClient:
551
552
  self,
552
553
  group_id: str,
553
554
  *,
554
- messages: typing.Sequence[MessageCreate],
555
+ messages: typing.Sequence[LettaRequestMessagesItem],
555
556
  max_steps: typing.Optional[int] = OMIT,
556
557
  use_assistant_message: typing.Optional[bool] = OMIT,
557
558
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -568,7 +569,7 @@ class AsyncRawMessagesClient:
568
569
  ----------
569
570
  group_id : str
570
571
 
571
- messages : typing.Sequence[MessageCreate]
572
+ messages : typing.Sequence[LettaRequestMessagesItem]
572
573
  The messages to be sent to the agent.
573
574
 
574
575
  max_steps : typing.Optional[int]
@@ -602,7 +603,7 @@ class AsyncRawMessagesClient:
602
603
  method="POST",
603
604
  json={
604
605
  "messages": convert_and_respect_annotation_metadata(
605
- object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
606
+ object_=messages, annotation=typing.Sequence[LettaRequestMessagesItem], direction="write"
606
607
  ),
607
608
  "max_steps": max_steps,
608
609
  "use_assistant_message": use_assistant_message,
@@ -648,7 +649,7 @@ class AsyncRawMessagesClient:
648
649
  self,
649
650
  group_id: str,
650
651
  *,
651
- messages: typing.Sequence[MessageCreate],
652
+ messages: typing.Sequence[LettaStreamingRequestMessagesItem],
652
653
  max_steps: typing.Optional[int] = OMIT,
653
654
  use_assistant_message: typing.Optional[bool] = OMIT,
654
655
  assistant_message_tool_name: typing.Optional[str] = OMIT,
@@ -669,7 +670,7 @@ class AsyncRawMessagesClient:
669
670
  ----------
670
671
  group_id : str
671
672
 
672
- messages : typing.Sequence[MessageCreate]
673
+ messages : typing.Sequence[LettaStreamingRequestMessagesItem]
673
674
  The messages to be sent to the agent.
674
675
 
675
676
  max_steps : typing.Optional[int]
@@ -691,7 +692,7 @@ class AsyncRawMessagesClient:
691
692
  If set to True, enables reasoning before responses or tool calls from the agent.
692
693
 
693
694
  stream_tokens : typing.Optional[bool]
694
- Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
695
+ Flag to determine if individual tokens should be streamed, rather than streaming per step.
695
696
 
696
697
  include_pings : typing.Optional[bool]
697
698
  Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts.
@@ -712,7 +713,7 @@ class AsyncRawMessagesClient:
712
713
  method="POST",
713
714
  json={
714
715
  "messages": convert_and_respect_annotation_metadata(
715
- object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
716
+ object_=messages, annotation=typing.Sequence[LettaStreamingRequestMessagesItem], direction="write"
716
717
  ),
717
718
  "max_steps": max_steps,
718
719
  "use_assistant_message": use_assistant_message,