@letta-ai/letta-client 1.0.0-alpha.14 → 1.0.0-alpha.16

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.
Files changed (258) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +20 -20
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +20 -20
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agents/agents.d.mts +163 -52
  10. package/resources/agents/agents.d.mts.map +1 -1
  11. package/resources/agents/agents.d.ts +163 -52
  12. package/resources/agents/agents.d.ts.map +1 -1
  13. package/resources/agents/agents.js +0 -6
  14. package/resources/agents/agents.js.map +1 -1
  15. package/resources/agents/agents.mjs +1 -7
  16. package/resources/agents/agents.mjs.map +1 -1
  17. package/resources/agents/folders.d.mts +52 -76
  18. package/resources/agents/folders.d.mts.map +1 -1
  19. package/resources/agents/folders.d.ts +52 -76
  20. package/resources/agents/folders.d.ts.map +1 -1
  21. package/resources/agents/folders.js +5 -1
  22. package/resources/agents/folders.js.map +1 -1
  23. package/resources/agents/folders.mjs +5 -1
  24. package/resources/agents/folders.mjs.map +1 -1
  25. package/resources/agents/index.d.mts +4 -4
  26. package/resources/agents/index.d.mts.map +1 -1
  27. package/resources/agents/index.d.ts +4 -4
  28. package/resources/agents/index.d.ts.map +1 -1
  29. package/resources/agents/index.js.map +1 -1
  30. package/resources/agents/index.mjs.map +1 -1
  31. package/resources/agents/messages.d.mts +344 -38
  32. package/resources/agents/messages.d.mts.map +1 -1
  33. package/resources/agents/messages.d.ts +344 -38
  34. package/resources/agents/messages.d.ts.map +1 -1
  35. package/resources/agents/messages.js +5 -5
  36. package/resources/agents/messages.js.map +1 -1
  37. package/resources/agents/messages.mjs +5 -5
  38. package/resources/agents/messages.mjs.map +1 -1
  39. package/resources/agents/tools.d.mts +6 -27
  40. package/resources/agents/tools.d.mts.map +1 -1
  41. package/resources/agents/tools.d.ts +6 -27
  42. package/resources/agents/tools.d.ts.map +1 -1
  43. package/resources/agents/tools.js +5 -1
  44. package/resources/agents/tools.js.map +1 -1
  45. package/resources/agents/tools.mjs +5 -1
  46. package/resources/agents/tools.mjs.map +1 -1
  47. package/resources/archives.d.mts +9 -31
  48. package/resources/archives.d.mts.map +1 -1
  49. package/resources/archives.d.ts +9 -31
  50. package/resources/archives.d.ts.map +1 -1
  51. package/resources/archives.js +2 -1
  52. package/resources/archives.js.map +1 -1
  53. package/resources/archives.mjs +2 -1
  54. package/resources/archives.mjs.map +1 -1
  55. package/resources/batches/batches.d.mts +52 -34
  56. package/resources/batches/batches.d.mts.map +1 -1
  57. package/resources/batches/batches.d.ts +52 -34
  58. package/resources/batches/batches.d.ts.map +1 -1
  59. package/resources/batches/batches.js +2 -1
  60. package/resources/batches/batches.js.map +1 -1
  61. package/resources/batches/batches.mjs +2 -1
  62. package/resources/batches/batches.mjs.map +1 -1
  63. package/resources/batches/index.d.mts +2 -2
  64. package/resources/batches/index.d.mts.map +1 -1
  65. package/resources/batches/index.d.ts +2 -2
  66. package/resources/batches/index.d.ts.map +1 -1
  67. package/resources/batches/index.js.map +1 -1
  68. package/resources/batches/index.mjs.map +1 -1
  69. package/resources/batches/messages.d.mts +6 -30
  70. package/resources/batches/messages.d.mts.map +1 -1
  71. package/resources/batches/messages.d.ts +6 -30
  72. package/resources/batches/messages.d.ts.map +1 -1
  73. package/resources/batches/messages.js +2 -1
  74. package/resources/batches/messages.js.map +1 -1
  75. package/resources/batches/messages.mjs +2 -1
  76. package/resources/batches/messages.mjs.map +1 -1
  77. package/resources/blocks/blocks.d.mts +1 -6
  78. package/resources/blocks/blocks.d.mts.map +1 -1
  79. package/resources/blocks/blocks.d.ts +1 -6
  80. package/resources/blocks/blocks.d.ts.map +1 -1
  81. package/resources/blocks/blocks.js +0 -6
  82. package/resources/blocks/blocks.js.map +1 -1
  83. package/resources/blocks/blocks.mjs +0 -6
  84. package/resources/blocks/blocks.mjs.map +1 -1
  85. package/resources/blocks/index.d.mts +1 -1
  86. package/resources/blocks/index.d.mts.map +1 -1
  87. package/resources/blocks/index.d.ts +1 -1
  88. package/resources/blocks/index.d.ts.map +1 -1
  89. package/resources/blocks/index.js.map +1 -1
  90. package/resources/blocks/index.mjs.map +1 -1
  91. package/resources/folders/files.d.mts +73 -97
  92. package/resources/folders/files.d.mts.map +1 -1
  93. package/resources/folders/files.d.ts +73 -97
  94. package/resources/folders/files.d.ts.map +1 -1
  95. package/resources/folders/files.js +5 -1
  96. package/resources/folders/files.js.map +1 -1
  97. package/resources/folders/files.mjs +5 -1
  98. package/resources/folders/files.mjs.map +1 -1
  99. package/resources/folders/folders.d.mts +11 -38
  100. package/resources/folders/folders.d.mts.map +1 -1
  101. package/resources/folders/folders.d.ts +11 -38
  102. package/resources/folders/folders.d.ts.map +1 -1
  103. package/resources/folders/folders.js +2 -7
  104. package/resources/folders/folders.js.map +1 -1
  105. package/resources/folders/folders.mjs +2 -7
  106. package/resources/folders/folders.mjs.map +1 -1
  107. package/resources/folders/index.d.mts +2 -2
  108. package/resources/folders/index.d.mts.map +1 -1
  109. package/resources/folders/index.d.ts +2 -2
  110. package/resources/folders/index.d.ts.map +1 -1
  111. package/resources/folders/index.js.map +1 -1
  112. package/resources/folders/index.mjs.map +1 -1
  113. package/resources/groups/groups.d.mts +1 -6
  114. package/resources/groups/groups.d.mts.map +1 -1
  115. package/resources/groups/groups.d.ts +1 -6
  116. package/resources/groups/groups.d.ts.map +1 -1
  117. package/resources/groups/groups.js +0 -6
  118. package/resources/groups/groups.js.map +1 -1
  119. package/resources/groups/groups.mjs +0 -6
  120. package/resources/groups/groups.mjs.map +1 -1
  121. package/resources/groups/index.d.mts +1 -1
  122. package/resources/groups/index.d.mts.map +1 -1
  123. package/resources/groups/index.d.ts +1 -1
  124. package/resources/groups/index.d.ts.map +1 -1
  125. package/resources/groups/index.js.map +1 -1
  126. package/resources/groups/index.mjs.map +1 -1
  127. package/resources/groups/messages.d.mts +97 -11
  128. package/resources/groups/messages.d.mts.map +1 -1
  129. package/resources/groups/messages.d.ts +97 -11
  130. package/resources/groups/messages.d.ts.map +1 -1
  131. package/resources/identities/identities.d.mts +9 -36
  132. package/resources/identities/identities.d.mts.map +1 -1
  133. package/resources/identities/identities.d.ts +9 -36
  134. package/resources/identities/identities.d.ts.map +1 -1
  135. package/resources/identities/identities.js +2 -7
  136. package/resources/identities/identities.js.map +1 -1
  137. package/resources/identities/identities.mjs +2 -7
  138. package/resources/identities/identities.mjs.map +1 -1
  139. package/resources/identities/index.d.mts +1 -1
  140. package/resources/identities/index.d.mts.map +1 -1
  141. package/resources/identities/index.d.ts +1 -1
  142. package/resources/identities/index.d.ts.map +1 -1
  143. package/resources/identities/index.js.map +1 -1
  144. package/resources/identities/index.mjs.map +1 -1
  145. package/resources/index.d.mts +10 -10
  146. package/resources/index.d.mts.map +1 -1
  147. package/resources/index.d.ts +10 -10
  148. package/resources/index.d.ts.map +1 -1
  149. package/resources/index.js.map +1 -1
  150. package/resources/index.mjs.map +1 -1
  151. package/resources/mcp-servers/index.d.mts +2 -3
  152. package/resources/mcp-servers/index.d.mts.map +1 -1
  153. package/resources/mcp-servers/index.d.ts +2 -3
  154. package/resources/mcp-servers/index.d.ts.map +1 -1
  155. package/resources/mcp-servers/index.js +1 -3
  156. package/resources/mcp-servers/index.js.map +1 -1
  157. package/resources/mcp-servers/index.mjs +1 -2
  158. package/resources/mcp-servers/index.mjs.map +1 -1
  159. package/resources/mcp-servers/mcp-servers.d.mts +302 -378
  160. package/resources/mcp-servers/mcp-servers.d.mts.map +1 -1
  161. package/resources/mcp-servers/mcp-servers.d.ts +302 -378
  162. package/resources/mcp-servers/mcp-servers.d.ts.map +1 -1
  163. package/resources/mcp-servers/mcp-servers.js +17 -4
  164. package/resources/mcp-servers/mcp-servers.js.map +1 -1
  165. package/resources/mcp-servers/mcp-servers.mjs +17 -4
  166. package/resources/mcp-servers/mcp-servers.mjs.map +1 -1
  167. package/resources/mcp-servers/tools.d.mts +3 -41
  168. package/resources/mcp-servers/tools.d.mts.map +1 -1
  169. package/resources/mcp-servers/tools.d.ts +3 -41
  170. package/resources/mcp-servers/tools.d.ts.map +1 -1
  171. package/resources/mcp-servers/tools.js.map +1 -1
  172. package/resources/mcp-servers/tools.mjs.map +1 -1
  173. package/resources/models/embeddings.d.mts +71 -2
  174. package/resources/models/embeddings.d.mts.map +1 -1
  175. package/resources/models/embeddings.d.ts +71 -2
  176. package/resources/models/embeddings.d.ts.map +1 -1
  177. package/resources/models/embeddings.js +5 -1
  178. package/resources/models/embeddings.js.map +1 -1
  179. package/resources/models/embeddings.mjs +5 -1
  180. package/resources/models/embeddings.mjs.map +1 -1
  181. package/resources/models/models.d.mts +113 -2
  182. package/resources/models/models.d.mts.map +1 -1
  183. package/resources/models/models.d.ts +113 -2
  184. package/resources/models/models.d.ts.map +1 -1
  185. package/resources/models/models.js +5 -1
  186. package/resources/models/models.js.map +1 -1
  187. package/resources/models/models.mjs +5 -1
  188. package/resources/models/models.mjs.map +1 -1
  189. package/resources/runs/index.d.mts +1 -1
  190. package/resources/runs/index.d.mts.map +1 -1
  191. package/resources/runs/index.d.ts +1 -1
  192. package/resources/runs/index.d.ts.map +1 -1
  193. package/resources/runs/index.js.map +1 -1
  194. package/resources/runs/index.mjs.map +1 -1
  195. package/resources/runs/runs.d.mts +6 -27
  196. package/resources/runs/runs.d.mts.map +1 -1
  197. package/resources/runs/runs.d.ts +6 -27
  198. package/resources/runs/runs.d.ts.map +1 -1
  199. package/resources/runs/runs.js +2 -1
  200. package/resources/runs/runs.js.map +1 -1
  201. package/resources/runs/runs.mjs +2 -1
  202. package/resources/runs/runs.mjs.map +1 -1
  203. package/resources/steps/messages.d.mts +1 -1
  204. package/resources/steps/messages.d.mts.map +1 -1
  205. package/resources/steps/messages.d.ts +1 -1
  206. package/resources/steps/messages.d.ts.map +1 -1
  207. package/resources/tools.d.mts +6 -64
  208. package/resources/tools.d.mts.map +1 -1
  209. package/resources/tools.d.ts +6 -64
  210. package/resources/tools.d.ts.map +1 -1
  211. package/resources/tools.js +2 -7
  212. package/resources/tools.js.map +1 -1
  213. package/resources/tools.mjs +2 -7
  214. package/resources/tools.mjs.map +1 -1
  215. package/src/client.ts +37 -28
  216. package/src/resources/agents/agents.ts +185 -60
  217. package/src/resources/agents/folders.ts +60 -85
  218. package/src/resources/agents/index.ts +7 -2
  219. package/src/resources/agents/messages.ts +504 -40
  220. package/src/resources/agents/tools.ts +10 -34
  221. package/src/resources/archives.ts +12 -39
  222. package/src/resources/batches/batches.ts +74 -46
  223. package/src/resources/batches/index.ts +2 -2
  224. package/src/resources/batches/messages.ts +12 -37
  225. package/src/resources/blocks/blocks.ts +0 -10
  226. package/src/resources/blocks/index.ts +0 -1
  227. package/src/resources/folders/files.ts +88 -113
  228. package/src/resources/folders/folders.ts +14 -49
  229. package/src/resources/folders/index.ts +2 -2
  230. package/src/resources/groups/groups.ts +0 -10
  231. package/src/resources/groups/index.ts +0 -1
  232. package/src/resources/groups/messages.ts +139 -12
  233. package/src/resources/identities/identities.ts +12 -49
  234. package/src/resources/identities/index.ts +1 -2
  235. package/src/resources/index.ts +19 -14
  236. package/src/resources/mcp-servers/index.ts +14 -9
  237. package/src/resources/mcp-servers/mcp-servers.ts +313 -402
  238. package/src/resources/mcp-servers/tools.ts +6 -47
  239. package/src/resources/models/embeddings.ts +105 -2
  240. package/src/resources/models/models.ts +158 -2
  241. package/src/resources/runs/index.ts +1 -1
  242. package/src/resources/runs/runs.ts +11 -39
  243. package/src/resources/steps/messages.ts +3 -1
  244. package/src/resources/tools.ts +8 -88
  245. package/src/version.ts +1 -1
  246. package/version.d.mts +1 -1
  247. package/version.d.ts +1 -1
  248. package/version.js +1 -1
  249. package/version.mjs +1 -1
  250. package/resources/mcp-servers/refresh.d.mts +0 -24
  251. package/resources/mcp-servers/refresh.d.mts.map +0 -1
  252. package/resources/mcp-servers/refresh.d.ts +0 -24
  253. package/resources/mcp-servers/refresh.d.ts.map +0 -1
  254. package/resources/mcp-servers/refresh.js +0 -27
  255. package/resources/mcp-servers/refresh.js.map +0 -1
  256. package/resources/mcp-servers/refresh.mjs +0 -23
  257. package/resources/mcp-servers/refresh.mjs.map +0 -1
  258. package/src/resources/mcp-servers/refresh.ts +0 -43
@@ -4,7 +4,7 @@ import * as ToolsAPI from "../tools.mjs";
4
4
  import * as AgentsAPI from "./agents.mjs";
5
5
  import * as RunsAPI from "../runs/runs.mjs";
6
6
  import { APIPromise } from "../../core/api-promise.mjs";
7
- import { ArrayPage, type ArrayPageParams, PagePromise } from "../../core/pagination.mjs";
7
+ import { ArrayPage, type ArrayPageParams, ObjectPage, PagePromise } from "../../core/pagination.mjs";
8
8
  import { Stream } from "../../core/streaming.mjs";
9
9
  import { RequestOptions } from "../../internal/request-options.mjs";
10
10
  export declare class Messages extends APIResource {
@@ -30,8 +30,22 @@ export declare class Messages extends APIResource {
30
30
  /**
31
31
  * Process a user message and return the agent's response. This endpoint accepts a
32
32
  * message from a user and processes it through the agent.
33
+ *
34
+ * The response format is controlled by the `streaming` field in the request body:
35
+ *
36
+ * - If `streaming=false` (default): Returns a complete LettaResponse with all
37
+ * messages
38
+ * - If `streaming=true`: Returns a Server-Sent Events (SSE) stream
39
+ *
40
+ * Additional streaming options (only used when streaming=true):
41
+ *
42
+ * - `stream_tokens`: Stream individual tokens instead of complete steps
43
+ * - `include_pings`: Include keepalive pings to prevent connection timeouts
44
+ * - `background`: Process the request in the background
33
45
  */
34
- send(agentID: string, body: MessageSendParams, options?: RequestOptions): APIPromise<LettaResponse>;
46
+ send(agentID: string, body: MessageSendParamsNonStreaming, options?: RequestOptions): APIPromise<LettaResponse>;
47
+ send(agentID: string, body: MessageSendParamsStreaming, options?: RequestOptions): APIPromise<Stream<LettaStreamingResponse>>;
48
+ send(agentID: string, body: MessageSendParamsBase, options?: RequestOptions): APIPromise<Stream<LettaStreamingResponse> | LettaResponse>;
35
49
  /**
36
50
  * Asynchronously process a user message and return a run object. The actual
37
51
  * processing happens in the background, and the status can be checked using the
@@ -53,6 +67,8 @@ export declare class Messages extends APIResource {
53
67
  summarize(agentID: string, options?: RequestOptions): APIPromise<void>;
54
68
  }
55
69
  export type LettaMessageUnionsArrayPage = ArrayPage<LettaMessageUnion>;
70
+ export type RunsArrayPage = ArrayPage<Run>;
71
+ export type MessagesObjectPage = ObjectPage<Message>;
56
72
  /**
57
73
  * Input to approve or deny a tool call request
58
74
  */
@@ -69,6 +85,10 @@ export interface ApprovalCreate {
69
85
  * @deprecated Whether the tool has been approved
70
86
  */
71
87
  approve?: boolean | null;
88
+ /**
89
+ * The multi-agent group that the message was sent in
90
+ */
91
+ group_id?: string | null;
72
92
  /**
73
93
  * @deprecated An optional explanation for the provided approval status
74
94
  */
@@ -219,6 +239,26 @@ export interface AssistantMessage {
219
239
  seq_id?: number | null;
220
240
  step_id?: string | null;
221
241
  }
242
+ /**
243
+ * A message for notifying the developer that an event that has occured (e.g. a
244
+ * compaction). Events are NOT part of the context window.
245
+ */
246
+ export interface EventMessage {
247
+ id: string;
248
+ date: string;
249
+ event_data: {
250
+ [key: string]: unknown;
251
+ };
252
+ event_type: 'compaction';
253
+ is_err?: boolean | null;
254
+ message_type?: 'event';
255
+ name?: string | null;
256
+ otid?: string | null;
257
+ run_id?: string | null;
258
+ sender_id?: string | null;
259
+ seq_id?: number | null;
260
+ step_id?: string | null;
261
+ }
222
262
  /**
223
263
  * Representation of an agent's internal reasoning where reasoning content has been
224
264
  * hidden from the response.
@@ -337,12 +377,8 @@ export interface LettaAssistantMessageContentUnion {
337
377
  * created in ISO format name (Optional[str]): The name of the sender of the
338
378
  * message content (str): The message content sent by the system
339
379
  */
340
- export type LettaMessageUnion = SystemMessage | UserMessage | ReasoningMessage | HiddenReasoningMessage | ToolCallMessage | ToolsAPI.ToolReturnMessage | AssistantMessage | ApprovalRequestMessage | ApprovalResponseMessage;
380
+ export type LettaMessageUnion = SystemMessage | UserMessage | ReasoningMessage | HiddenReasoningMessage | ToolCallMessage | ToolsAPI.ToolReturnMessage | AssistantMessage | ApprovalRequestMessage | ApprovalResponseMessage | SummaryMessage | EventMessage;
341
381
  export interface LettaRequest {
342
- /**
343
- * The messages to be sent to the agent.
344
- */
345
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
346
382
  /**
347
383
  * @deprecated The name of the message argument in the designated message tool.
348
384
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -364,10 +400,19 @@ export interface LettaRequest {
364
400
  * all messages.
365
401
  */
366
402
  include_return_message_types?: Array<MessageType> | null;
403
+ /**
404
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
405
+ * 'user', 'content': input}].
406
+ */
407
+ input?: string | Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | LettaRequest.SummarizedReasoningContent> | null;
367
408
  /**
368
409
  * Maximum number of steps the agent should take to process the request.
369
410
  */
370
411
  max_steps?: number;
412
+ /**
413
+ * The messages to be sent to the agent.
414
+ */
415
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
371
416
  /**
372
417
  * @deprecated Whether the server should parse specific tool call arguments
373
418
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -375,6 +420,41 @@ export interface LettaRequest {
375
420
  */
376
421
  use_assistant_message?: boolean;
377
422
  }
423
+ export declare namespace LettaRequest {
424
+ /**
425
+ * The style of reasoning content returned by the OpenAI Responses API
426
+ */
427
+ interface SummarizedReasoningContent {
428
+ /**
429
+ * The unique identifier for this reasoning step.
430
+ */
431
+ id: string;
432
+ /**
433
+ * Summaries of the reasoning content.
434
+ */
435
+ summary: Array<SummarizedReasoningContent.Summary>;
436
+ /**
437
+ * The encrypted reasoning content.
438
+ */
439
+ encrypted_content?: string;
440
+ /**
441
+ * Indicates this is a summarized reasoning step.
442
+ */
443
+ type?: 'summarized_reasoning';
444
+ }
445
+ namespace SummarizedReasoningContent {
446
+ interface Summary {
447
+ /**
448
+ * The index of the summary part.
449
+ */
450
+ index: number;
451
+ /**
452
+ * The text of the summary part.
453
+ */
454
+ text: string;
455
+ }
456
+ }
457
+ }
378
458
  /**
379
459
  * Response object from an agent interaction, consisting of the new messages
380
460
  * generated by the agent and usage statistics. The type of the returned messages
@@ -440,10 +520,6 @@ export declare namespace LettaResponse {
440
520
  }
441
521
  }
442
522
  export interface LettaStreamingRequest {
443
- /**
444
- * The messages to be sent to the agent.
445
- */
446
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
447
523
  /**
448
524
  * @deprecated The name of the message argument in the designated message tool.
449
525
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -456,7 +532,8 @@ export interface LettaStreamingRequest {
456
532
  */
457
533
  assistant_message_tool_name?: string;
458
534
  /**
459
- * Whether to process the request in the background.
535
+ * Whether to process the request in the background (only used when
536
+ * streaming=true).
460
537
  */
461
538
  background?: boolean;
462
539
  /**
@@ -466,7 +543,7 @@ export interface LettaStreamingRequest {
466
543
  enable_thinking?: string;
467
544
  /**
468
545
  * Whether to include periodic keepalive ping messages in the stream to prevent
469
- * connection timeouts.
546
+ * connection timeouts (only used when streaming=true).
470
547
  */
471
548
  include_pings?: boolean;
472
549
  /**
@@ -474,15 +551,29 @@ export interface LettaStreamingRequest {
474
551
  * all messages.
475
552
  */
476
553
  include_return_message_types?: Array<MessageType> | null;
554
+ /**
555
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
556
+ * 'user', 'content': input}].
557
+ */
558
+ input?: string | Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | LettaStreamingRequest.SummarizedReasoningContent> | null;
477
559
  /**
478
560
  * Maximum number of steps the agent should take to process the request.
479
561
  */
480
562
  max_steps?: number;
563
+ /**
564
+ * The messages to be sent to the agent.
565
+ */
566
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
481
567
  /**
482
568
  * Flag to determine if individual tokens should be streamed, rather than streaming
483
- * per step.
569
+ * per step (only used when streaming=true).
484
570
  */
485
571
  stream_tokens?: boolean;
572
+ /**
573
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
574
+ * returns a complete response.
575
+ */
576
+ streaming?: boolean;
486
577
  /**
487
578
  * @deprecated Whether the server should parse specific tool call arguments
488
579
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -490,6 +581,41 @@ export interface LettaStreamingRequest {
490
581
  */
491
582
  use_assistant_message?: boolean;
492
583
  }
584
+ export declare namespace LettaStreamingRequest {
585
+ /**
586
+ * The style of reasoning content returned by the OpenAI Responses API
587
+ */
588
+ interface SummarizedReasoningContent {
589
+ /**
590
+ * The unique identifier for this reasoning step.
591
+ */
592
+ id: string;
593
+ /**
594
+ * Summaries of the reasoning content.
595
+ */
596
+ summary: Array<SummarizedReasoningContent.Summary>;
597
+ /**
598
+ * The encrypted reasoning content.
599
+ */
600
+ encrypted_content?: string;
601
+ /**
602
+ * Indicates this is a summarized reasoning step.
603
+ */
604
+ type?: 'summarized_reasoning';
605
+ }
606
+ namespace SummarizedReasoningContent {
607
+ interface Summary {
608
+ /**
609
+ * The index of the summary part.
610
+ */
611
+ index: number;
612
+ /**
613
+ * The text of the summary part.
614
+ */
615
+ text: string;
616
+ }
617
+ }
618
+ }
493
619
  /**
494
620
  * Streaming response type for Server-Sent Events (SSE) endpoints. Each event in
495
621
  * the stream will be one of these types.
@@ -576,13 +702,13 @@ export type LettaUserMessageContentUnion = TextContent | ImageContent;
576
702
  */
577
703
  export interface Message {
578
704
  /**
579
- * The role of the participant.
705
+ * The human-friendly ID of the Message
580
706
  */
581
- role: MessageRole;
707
+ id: string;
582
708
  /**
583
- * The human-friendly ID of the Message
709
+ * The role of the participant.
584
710
  */
585
- id?: string;
711
+ role: MessageRole;
586
712
  /**
587
713
  * The unique identifier of the agent.
588
714
  */
@@ -880,13 +1006,13 @@ export interface RedactedReasoningContent {
880
1006
  */
881
1007
  export interface Run {
882
1008
  /**
883
- * The unique identifier of the agent associated with the run.
1009
+ * The human-friendly ID of the Run
884
1010
  */
885
- agent_id: string;
1011
+ id: string;
886
1012
  /**
887
- * The human-friendly ID of the Run
1013
+ * The unique identifier of the agent associated with the run.
888
1014
  */
889
- id?: string;
1015
+ agent_id: string;
890
1016
  /**
891
1017
  * Whether the run was created in background mode.
892
1018
  */
@@ -971,6 +1097,23 @@ export declare namespace Run {
971
1097
  use_assistant_message?: boolean;
972
1098
  }
973
1099
  }
1100
+ /**
1101
+ * A message representing a summary of the conversation. Sent to the LLM as a user
1102
+ * or system message depending on the provider.
1103
+ */
1104
+ export interface SummaryMessage {
1105
+ id: string;
1106
+ date: string;
1107
+ summary: string;
1108
+ is_err?: boolean | null;
1109
+ message_type?: 'summary';
1110
+ name?: string | null;
1111
+ otid?: string | null;
1112
+ run_id?: string | null;
1113
+ sender_id?: string | null;
1114
+ seq_id?: number | null;
1115
+ step_id?: string | null;
1116
+ }
974
1117
  /**
975
1118
  * A message generated by the system. Never streamed back on a response, only used
976
1119
  * for cursor pagination.
@@ -1173,7 +1316,7 @@ export type MessageCancelResponse = {
1173
1316
  * created in ISO format name (Optional[str]): The name of the sender of the
1174
1317
  * message content (str): The message content sent by the system
1175
1318
  */
1176
- export type MessageModifyResponse = SystemMessage | UserMessage | ReasoningMessage | HiddenReasoningMessage | ToolCallMessage | ToolsAPI.ToolReturnMessage | AssistantMessage | ApprovalRequestMessage | ApprovalResponseMessage;
1319
+ export type MessageModifyResponse = SystemMessage | UserMessage | ReasoningMessage | HiddenReasoningMessage | ToolCallMessage | ToolsAPI.ToolReturnMessage | AssistantMessage | ApprovalRequestMessage | ApprovalResponseMessage | SummaryMessage | EventMessage;
1177
1320
  export interface MessageListParams extends ArrayPageParams {
1178
1321
  /**
1179
1322
  * @deprecated The name of the message argument.
@@ -1271,11 +1414,8 @@ export interface MessageResetParams {
1271
1414
  */
1272
1415
  add_default_initial_messages?: boolean;
1273
1416
  }
1274
- export interface MessageSendParams {
1275
- /**
1276
- * The messages to be sent to the agent.
1277
- */
1278
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1417
+ export type MessageSendParams = MessageSendParamsNonStreaming | MessageSendParamsStreaming;
1418
+ export interface MessageSendParamsBase {
1279
1419
  /**
1280
1420
  * @deprecated The name of the message argument in the designated message tool.
1281
1421
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1287,20 +1427,49 @@ export interface MessageSendParams {
1287
1427
  * agent types, but deprecated for letta_v1_agent onward.
1288
1428
  */
1289
1429
  assistant_message_tool_name?: string;
1430
+ /**
1431
+ * Whether to process the request in the background (only used when
1432
+ * streaming=true).
1433
+ */
1434
+ background?: boolean;
1290
1435
  /**
1291
1436
  * @deprecated If set to True, enables reasoning before responses or tool calls
1292
1437
  * from the agent.
1293
1438
  */
1294
1439
  enable_thinking?: string;
1440
+ /**
1441
+ * Whether to include periodic keepalive ping messages in the stream to prevent
1442
+ * connection timeouts (only used when streaming=true).
1443
+ */
1444
+ include_pings?: boolean;
1295
1445
  /**
1296
1446
  * Only return specified message types in the response. If `None` (default) returns
1297
1447
  * all messages.
1298
1448
  */
1299
1449
  include_return_message_types?: Array<MessageType> | null;
1450
+ /**
1451
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1452
+ * 'user', 'content': input}].
1453
+ */
1454
+ input?: string | Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | MessageSendParams.SummarizedReasoningContent> | null;
1300
1455
  /**
1301
1456
  * Maximum number of steps the agent should take to process the request.
1302
1457
  */
1303
1458
  max_steps?: number;
1459
+ /**
1460
+ * The messages to be sent to the agent.
1461
+ */
1462
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1463
+ /**
1464
+ * Flag to determine if individual tokens should be streamed, rather than streaming
1465
+ * per step (only used when streaming=true).
1466
+ */
1467
+ stream_tokens?: boolean;
1468
+ /**
1469
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1470
+ * returns a complete response.
1471
+ */
1472
+ streaming?: boolean;
1304
1473
  /**
1305
1474
  * @deprecated Whether the server should parse specific tool call arguments
1306
1475
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1308,11 +1477,58 @@ export interface MessageSendParams {
1308
1477
  */
1309
1478
  use_assistant_message?: boolean;
1310
1479
  }
1311
- export interface MessageSendAsyncParams {
1480
+ export declare namespace MessageSendParams {
1312
1481
  /**
1313
- * The messages to be sent to the agent.
1482
+ * The style of reasoning content returned by the OpenAI Responses API
1314
1483
  */
1315
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1484
+ interface SummarizedReasoningContent {
1485
+ /**
1486
+ * The unique identifier for this reasoning step.
1487
+ */
1488
+ id: string;
1489
+ /**
1490
+ * Summaries of the reasoning content.
1491
+ */
1492
+ summary: Array<SummarizedReasoningContent.Summary>;
1493
+ /**
1494
+ * The encrypted reasoning content.
1495
+ */
1496
+ encrypted_content?: string;
1497
+ /**
1498
+ * Indicates this is a summarized reasoning step.
1499
+ */
1500
+ type?: 'summarized_reasoning';
1501
+ }
1502
+ namespace SummarizedReasoningContent {
1503
+ interface Summary {
1504
+ /**
1505
+ * The index of the summary part.
1506
+ */
1507
+ index: number;
1508
+ /**
1509
+ * The text of the summary part.
1510
+ */
1511
+ text: string;
1512
+ }
1513
+ }
1514
+ type MessageSendParamsNonStreaming = MessagesAPI.MessageSendParamsNonStreaming;
1515
+ type MessageSendParamsStreaming = MessagesAPI.MessageSendParamsStreaming;
1516
+ }
1517
+ export interface MessageSendParamsNonStreaming extends MessageSendParamsBase {
1518
+ /**
1519
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1520
+ * returns a complete response.
1521
+ */
1522
+ streaming?: false;
1523
+ }
1524
+ export interface MessageSendParamsStreaming extends MessageSendParamsBase {
1525
+ /**
1526
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1527
+ * returns a complete response.
1528
+ */
1529
+ streaming: true;
1530
+ }
1531
+ export interface MessageSendAsyncParams {
1316
1532
  /**
1317
1533
  * @deprecated The name of the message argument in the designated message tool.
1318
1534
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1338,10 +1554,19 @@ export interface MessageSendAsyncParams {
1338
1554
  * all messages.
1339
1555
  */
1340
1556
  include_return_message_types?: Array<MessageType> | null;
1557
+ /**
1558
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1559
+ * 'user', 'content': input}].
1560
+ */
1561
+ input?: string | Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | MessageSendAsyncParams.SummarizedReasoningContent> | null;
1341
1562
  /**
1342
1563
  * Maximum number of steps the agent should take to process the request.
1343
1564
  */
1344
1565
  max_steps?: number;
1566
+ /**
1567
+ * The messages to be sent to the agent.
1568
+ */
1569
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1345
1570
  /**
1346
1571
  * @deprecated Whether the server should parse specific tool call arguments
1347
1572
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1349,11 +1574,42 @@ export interface MessageSendAsyncParams {
1349
1574
  */
1350
1575
  use_assistant_message?: boolean;
1351
1576
  }
1352
- export interface MessageStreamParams {
1577
+ export declare namespace MessageSendAsyncParams {
1353
1578
  /**
1354
- * The messages to be sent to the agent.
1579
+ * The style of reasoning content returned by the OpenAI Responses API
1355
1580
  */
1356
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1581
+ interface SummarizedReasoningContent {
1582
+ /**
1583
+ * The unique identifier for this reasoning step.
1584
+ */
1585
+ id: string;
1586
+ /**
1587
+ * Summaries of the reasoning content.
1588
+ */
1589
+ summary: Array<SummarizedReasoningContent.Summary>;
1590
+ /**
1591
+ * The encrypted reasoning content.
1592
+ */
1593
+ encrypted_content?: string;
1594
+ /**
1595
+ * Indicates this is a summarized reasoning step.
1596
+ */
1597
+ type?: 'summarized_reasoning';
1598
+ }
1599
+ namespace SummarizedReasoningContent {
1600
+ interface Summary {
1601
+ /**
1602
+ * The index of the summary part.
1603
+ */
1604
+ index: number;
1605
+ /**
1606
+ * The text of the summary part.
1607
+ */
1608
+ text: string;
1609
+ }
1610
+ }
1611
+ }
1612
+ export interface MessageStreamParams {
1357
1613
  /**
1358
1614
  * @deprecated The name of the message argument in the designated message tool.
1359
1615
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1366,7 +1622,8 @@ export interface MessageStreamParams {
1366
1622
  */
1367
1623
  assistant_message_tool_name?: string;
1368
1624
  /**
1369
- * Whether to process the request in the background.
1625
+ * Whether to process the request in the background (only used when
1626
+ * streaming=true).
1370
1627
  */
1371
1628
  background?: boolean;
1372
1629
  /**
@@ -1376,7 +1633,7 @@ export interface MessageStreamParams {
1376
1633
  enable_thinking?: string;
1377
1634
  /**
1378
1635
  * Whether to include periodic keepalive ping messages in the stream to prevent
1379
- * connection timeouts.
1636
+ * connection timeouts (only used when streaming=true).
1380
1637
  */
1381
1638
  include_pings?: boolean;
1382
1639
  /**
@@ -1384,15 +1641,29 @@ export interface MessageStreamParams {
1384
1641
  * all messages.
1385
1642
  */
1386
1643
  include_return_message_types?: Array<MessageType> | null;
1644
+ /**
1645
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1646
+ * 'user', 'content': input}].
1647
+ */
1648
+ input?: string | Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | MessageStreamParams.SummarizedReasoningContent> | null;
1387
1649
  /**
1388
1650
  * Maximum number of steps the agent should take to process the request.
1389
1651
  */
1390
1652
  max_steps?: number;
1653
+ /**
1654
+ * The messages to be sent to the agent.
1655
+ */
1656
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1391
1657
  /**
1392
1658
  * Flag to determine if individual tokens should be streamed, rather than streaming
1393
- * per step.
1659
+ * per step (only used when streaming=true).
1394
1660
  */
1395
1661
  stream_tokens?: boolean;
1662
+ /**
1663
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1664
+ * returns a complete response.
1665
+ */
1666
+ streaming?: boolean;
1396
1667
  /**
1397
1668
  * @deprecated Whether the server should parse specific tool call arguments
1398
1669
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1400,7 +1671,42 @@ export interface MessageStreamParams {
1400
1671
  */
1401
1672
  use_assistant_message?: boolean;
1402
1673
  }
1674
+ export declare namespace MessageStreamParams {
1675
+ /**
1676
+ * The style of reasoning content returned by the OpenAI Responses API
1677
+ */
1678
+ interface SummarizedReasoningContent {
1679
+ /**
1680
+ * The unique identifier for this reasoning step.
1681
+ */
1682
+ id: string;
1683
+ /**
1684
+ * Summaries of the reasoning content.
1685
+ */
1686
+ summary: Array<SummarizedReasoningContent.Summary>;
1687
+ /**
1688
+ * The encrypted reasoning content.
1689
+ */
1690
+ encrypted_content?: string;
1691
+ /**
1692
+ * Indicates this is a summarized reasoning step.
1693
+ */
1694
+ type?: 'summarized_reasoning';
1695
+ }
1696
+ namespace SummarizedReasoningContent {
1697
+ interface Summary {
1698
+ /**
1699
+ * The index of the summary part.
1700
+ */
1701
+ index: number;
1702
+ /**
1703
+ * The text of the summary part.
1704
+ */
1705
+ text: string;
1706
+ }
1707
+ }
1708
+ }
1403
1709
  export declare namespace Messages {
1404
- export { type ApprovalCreate as ApprovalCreate, type ApprovalRequestMessage as ApprovalRequestMessage, type ApprovalResponseMessage as ApprovalResponseMessage, type AssistantMessage as AssistantMessage, type HiddenReasoningMessage as HiddenReasoningMessage, type ImageContent as ImageContent, type JobStatus as JobStatus, type JobType as JobType, type LettaAssistantMessageContentUnion as LettaAssistantMessageContentUnion, type LettaMessageUnion as LettaMessageUnion, type LettaRequest as LettaRequest, type LettaResponse as LettaResponse, type LettaStreamingRequest as LettaStreamingRequest, type LettaStreamingResponse as LettaStreamingResponse, type LettaUserMessageContentUnion as LettaUserMessageContentUnion, type Message as Message, type MessageRole as MessageRole, type MessageType as MessageType, type OmittedReasoningContent as OmittedReasoningContent, type ReasoningContent as ReasoningContent, type ReasoningMessage as ReasoningMessage, type RedactedReasoningContent as RedactedReasoningContent, type Run as Run, type SystemMessage as SystemMessage, type TextContent as TextContent, type ToolCall as ToolCall, type ToolCallContent as ToolCallContent, type ToolCallDelta as ToolCallDelta, type ToolCallMessage as ToolCallMessage, type ToolReturn as ToolReturn, type ToolReturnContent as ToolReturnContent, type UpdateAssistantMessage as UpdateAssistantMessage, type UpdateReasoningMessage as UpdateReasoningMessage, type UpdateSystemMessage as UpdateSystemMessage, type UpdateUserMessage as UpdateUserMessage, type UserMessage as UserMessage, type MessageCancelResponse as MessageCancelResponse, type MessageModifyResponse as MessageModifyResponse, type LettaMessageUnionsArrayPage as LettaMessageUnionsArrayPage, type MessageListParams as MessageListParams, type MessageCancelParams as MessageCancelParams, type MessageModifyParams as MessageModifyParams, type MessageResetParams as MessageResetParams, type MessageSendParams as MessageSendParams, type MessageSendAsyncParams as MessageSendAsyncParams, type MessageStreamParams as MessageStreamParams, };
1710
+ export { type ApprovalCreate as ApprovalCreate, type ApprovalRequestMessage as ApprovalRequestMessage, type ApprovalResponseMessage as ApprovalResponseMessage, type AssistantMessage as AssistantMessage, type EventMessage as EventMessage, type HiddenReasoningMessage as HiddenReasoningMessage, type ImageContent as ImageContent, type JobStatus as JobStatus, type JobType as JobType, type LettaAssistantMessageContentUnion as LettaAssistantMessageContentUnion, type LettaMessageUnion as LettaMessageUnion, type LettaRequest as LettaRequest, type LettaResponse as LettaResponse, type LettaStreamingRequest as LettaStreamingRequest, type LettaStreamingResponse as LettaStreamingResponse, type LettaUserMessageContentUnion as LettaUserMessageContentUnion, type Message as Message, type MessageRole as MessageRole, type MessageType as MessageType, type OmittedReasoningContent as OmittedReasoningContent, type ReasoningContent as ReasoningContent, type ReasoningMessage as ReasoningMessage, type RedactedReasoningContent as RedactedReasoningContent, type Run as Run, type SummaryMessage as SummaryMessage, type SystemMessage as SystemMessage, type TextContent as TextContent, type ToolCall as ToolCall, type ToolCallContent as ToolCallContent, type ToolCallDelta as ToolCallDelta, type ToolCallMessage as ToolCallMessage, type ToolReturn as ToolReturn, type ToolReturnContent as ToolReturnContent, type UpdateAssistantMessage as UpdateAssistantMessage, type UpdateReasoningMessage as UpdateReasoningMessage, type UpdateSystemMessage as UpdateSystemMessage, type UpdateUserMessage as UpdateUserMessage, type UserMessage as UserMessage, type MessageCancelResponse as MessageCancelResponse, type MessageModifyResponse as MessageModifyResponse, type LettaMessageUnionsArrayPage as LettaMessageUnionsArrayPage, type MessageListParams as MessageListParams, type MessageCancelParams as MessageCancelParams, type MessageModifyParams as MessageModifyParams, type MessageResetParams as MessageResetParams, type MessageSendParams as MessageSendParams, type MessageSendParamsNonStreaming as MessageSendParamsNonStreaming, type MessageSendParamsStreaming as MessageSendParamsStreaming, type MessageSendAsyncParams as MessageSendAsyncParams, type MessageStreamParams as MessageStreamParams, };
1405
1711
  }
1406
1712
  //# sourceMappingURL=messages.d.mts.map