@letta-ai/letta-client 1.0.0-alpha.7 → 1.0.0

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 (507) hide show
  1. package/CHANGELOG.md +239 -0
  2. package/README.md +20 -71
  3. package/client.d.mts +61 -36
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +61 -36
  6. package/client.d.ts.map +1 -1
  7. package/client.js +53 -23
  8. package/client.js.map +1 -1
  9. package/client.mjs +53 -23
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +96 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +96 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +199 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +191 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/core/streaming.d.mts +33 -0
  20. package/core/streaming.d.mts.map +1 -0
  21. package/core/streaming.d.ts +33 -0
  22. package/core/streaming.d.ts.map +1 -0
  23. package/core/streaming.js +276 -0
  24. package/core/streaming.js.map +1 -0
  25. package/core/streaming.mjs +271 -0
  26. package/core/streaming.mjs.map +1 -0
  27. package/index.d.mts +1 -0
  28. package/index.d.mts.map +1 -1
  29. package/index.d.ts +1 -0
  30. package/index.d.ts.map +1 -1
  31. package/index.js +3 -1
  32. package/index.js.map +1 -1
  33. package/index.mjs +1 -0
  34. package/index.mjs.map +1 -1
  35. package/internal/decoders/line.d.mts +17 -0
  36. package/internal/decoders/line.d.mts.map +1 -0
  37. package/internal/decoders/line.d.ts +17 -0
  38. package/internal/decoders/line.d.ts.map +1 -0
  39. package/internal/decoders/line.js +113 -0
  40. package/internal/decoders/line.js.map +1 -0
  41. package/internal/decoders/line.mjs +108 -0
  42. package/internal/decoders/line.mjs.map +1 -0
  43. package/internal/parse.d.mts.map +1 -1
  44. package/internal/parse.d.ts.map +1 -1
  45. package/internal/parse.js +10 -0
  46. package/internal/parse.js.map +1 -1
  47. package/internal/parse.mjs +10 -0
  48. package/internal/parse.mjs.map +1 -1
  49. package/internal/request-options.d.mts +2 -0
  50. package/internal/request-options.d.mts.map +1 -1
  51. package/internal/request-options.d.ts +2 -0
  52. package/internal/request-options.d.ts.map +1 -1
  53. package/internal/request-options.js.map +1 -1
  54. package/internal/request-options.mjs.map +1 -1
  55. package/internal/tslib.js +17 -17
  56. package/package.json +21 -1
  57. package/pagination.d.mts +2 -0
  58. package/pagination.d.mts.map +1 -0
  59. package/pagination.d.ts +2 -0
  60. package/pagination.d.ts.map +1 -0
  61. package/pagination.js +6 -0
  62. package/pagination.js.map +1 -0
  63. package/pagination.mjs +2 -0
  64. package/pagination.mjs.map +1 -0
  65. package/resources/access-tokens.d.mts +105 -0
  66. package/resources/access-tokens.d.mts.map +1 -0
  67. package/resources/access-tokens.d.ts +105 -0
  68. package/resources/access-tokens.d.ts.map +1 -0
  69. package/resources/access-tokens.js +30 -0
  70. package/resources/access-tokens.js.map +1 -0
  71. package/resources/access-tokens.mjs +26 -0
  72. package/resources/access-tokens.mjs.map +1 -0
  73. package/resources/agents/agents.d.mts +517 -160
  74. package/resources/agents/agents.d.mts.map +1 -1
  75. package/resources/agents/agents.d.ts +517 -160
  76. package/resources/agents/agents.d.ts.map +1 -1
  77. package/resources/agents/agents.js +16 -21
  78. package/resources/agents/agents.js.map +1 -1
  79. package/resources/agents/agents.mjs +17 -22
  80. package/resources/agents/agents.mjs.map +1 -1
  81. package/resources/agents/archives.d.mts +31 -0
  82. package/resources/agents/archives.d.mts.map +1 -0
  83. package/resources/agents/archives.d.ts +31 -0
  84. package/resources/agents/archives.d.ts.map +1 -0
  85. package/resources/agents/archives.js +24 -0
  86. package/resources/agents/archives.js.map +1 -0
  87. package/resources/agents/archives.mjs +20 -0
  88. package/resources/agents/archives.mjs.map +1 -0
  89. package/resources/agents/blocks.d.mts +33 -55
  90. package/resources/agents/blocks.d.mts.map +1 -1
  91. package/resources/agents/blocks.d.ts +33 -55
  92. package/resources/agents/blocks.d.ts.map +1 -1
  93. package/resources/agents/blocks.js +2 -1
  94. package/resources/agents/blocks.js.map +1 -1
  95. package/resources/agents/blocks.mjs +2 -1
  96. package/resources/agents/blocks.mjs.map +1 -1
  97. package/resources/agents/files.d.mts +39 -79
  98. package/resources/agents/files.d.mts.map +1 -1
  99. package/resources/agents/files.d.ts +39 -79
  100. package/resources/agents/files.d.ts.map +1 -1
  101. package/resources/agents/files.js +5 -1
  102. package/resources/agents/files.js.map +1 -1
  103. package/resources/agents/files.mjs +5 -1
  104. package/resources/agents/files.mjs.map +1 -1
  105. package/resources/agents/folders.d.mts +50 -79
  106. package/resources/agents/folders.d.mts.map +1 -1
  107. package/resources/agents/folders.d.ts +50 -79
  108. package/resources/agents/folders.d.ts.map +1 -1
  109. package/resources/agents/folders.js +5 -1
  110. package/resources/agents/folders.js.map +1 -1
  111. package/resources/agents/folders.mjs +5 -1
  112. package/resources/agents/folders.mjs.map +1 -1
  113. package/resources/agents/groups.d.mts +6 -28
  114. package/resources/agents/groups.d.mts.map +1 -1
  115. package/resources/agents/groups.d.ts +6 -28
  116. package/resources/agents/groups.d.ts.map +1 -1
  117. package/resources/agents/groups.js +5 -1
  118. package/resources/agents/groups.js.map +1 -1
  119. package/resources/agents/groups.mjs +5 -1
  120. package/resources/agents/groups.mjs.map +1 -1
  121. package/resources/agents/identities.d.mts +31 -0
  122. package/resources/agents/identities.d.mts.map +1 -0
  123. package/resources/agents/identities.d.ts +31 -0
  124. package/resources/agents/identities.d.ts.map +1 -0
  125. package/resources/agents/identities.js +24 -0
  126. package/resources/agents/identities.js.map +1 -0
  127. package/resources/agents/identities.mjs +20 -0
  128. package/resources/agents/identities.mjs.map +1 -0
  129. package/resources/agents/index.d.mts +9 -7
  130. package/resources/agents/index.d.mts.map +1 -1
  131. package/resources/agents/index.d.ts +9 -7
  132. package/resources/agents/index.d.ts.map +1 -1
  133. package/resources/agents/index.js +5 -1
  134. package/resources/agents/index.js.map +1 -1
  135. package/resources/agents/index.mjs +2 -0
  136. package/resources/agents/index.mjs.map +1 -1
  137. package/resources/agents/messages.d.mts +642 -422
  138. package/resources/agents/messages.d.mts.map +1 -1
  139. package/resources/agents/messages.d.ts +642 -422
  140. package/resources/agents/messages.d.ts.map +1 -1
  141. package/resources/agents/messages.js +27 -26
  142. package/resources/agents/messages.js.map +1 -1
  143. package/resources/agents/messages.mjs +27 -26
  144. package/resources/agents/messages.mjs.map +1 -1
  145. package/resources/agents/tools.d.mts +9 -30
  146. package/resources/agents/tools.d.mts.map +1 -1
  147. package/resources/agents/tools.d.ts +9 -30
  148. package/resources/agents/tools.d.ts.map +1 -1
  149. package/resources/agents/tools.js +5 -1
  150. package/resources/agents/tools.js.map +1 -1
  151. package/resources/agents/tools.mjs +5 -1
  152. package/resources/agents/tools.mjs.map +1 -1
  153. package/resources/archives/archives.d.mts +115 -0
  154. package/resources/archives/archives.d.mts.map +1 -0
  155. package/resources/archives/archives.d.ts +115 -0
  156. package/resources/archives/archives.d.ts.map +1 -0
  157. package/resources/archives/archives.js +50 -0
  158. package/resources/archives/archives.js.map +1 -0
  159. package/resources/archives/archives.mjs +45 -0
  160. package/resources/archives/archives.mjs.map +1 -0
  161. package/resources/archives/index.d.mts +3 -0
  162. package/resources/archives/index.d.mts.map +1 -0
  163. package/resources/archives/index.d.ts +3 -0
  164. package/resources/archives/index.d.ts.map +1 -0
  165. package/resources/archives/index.js +9 -0
  166. package/resources/archives/index.js.map +1 -0
  167. package/resources/archives/index.mjs +4 -0
  168. package/resources/archives/index.mjs.map +1 -0
  169. package/resources/archives/passages.d.mts +113 -0
  170. package/resources/archives/passages.d.mts.map +1 -0
  171. package/resources/archives/passages.d.ts +113 -0
  172. package/resources/archives/passages.d.ts.map +1 -0
  173. package/resources/archives/passages.js +32 -0
  174. package/resources/archives/passages.js.map +1 -0
  175. package/resources/archives/passages.mjs +28 -0
  176. package/resources/archives/passages.mjs.map +1 -0
  177. package/resources/archives.d.mts +1 -130
  178. package/resources/archives.d.mts.map +1 -1
  179. package/resources/archives.d.ts +1 -130
  180. package/resources/archives.d.ts.map +1 -1
  181. package/resources/archives.js +2 -37
  182. package/resources/archives.js.map +1 -1
  183. package/resources/archives.mjs +1 -35
  184. package/resources/archives.mjs.map +1 -1
  185. package/resources/batches/batches.d.mts +52 -34
  186. package/resources/batches/batches.d.mts.map +1 -1
  187. package/resources/batches/batches.d.ts +52 -34
  188. package/resources/batches/batches.d.ts.map +1 -1
  189. package/resources/batches/batches.js +2 -1
  190. package/resources/batches/batches.js.map +1 -1
  191. package/resources/batches/batches.mjs +2 -1
  192. package/resources/batches/batches.mjs.map +1 -1
  193. package/resources/batches/index.d.mts +2 -2
  194. package/resources/batches/index.d.mts.map +1 -1
  195. package/resources/batches/index.d.ts +2 -2
  196. package/resources/batches/index.d.ts.map +1 -1
  197. package/resources/batches/index.js.map +1 -1
  198. package/resources/batches/index.mjs.map +1 -1
  199. package/resources/batches/messages.d.mts +6 -30
  200. package/resources/batches/messages.d.mts.map +1 -1
  201. package/resources/batches/messages.d.ts +6 -30
  202. package/resources/batches/messages.d.ts.map +1 -1
  203. package/resources/batches/messages.js +2 -1
  204. package/resources/batches/messages.js.map +1 -1
  205. package/resources/batches/messages.mjs +2 -1
  206. package/resources/batches/messages.mjs.map +1 -1
  207. package/resources/blocks/agents.d.mts +6 -28
  208. package/resources/blocks/agents.d.mts.map +1 -1
  209. package/resources/blocks/agents.d.ts +6 -28
  210. package/resources/blocks/agents.d.ts.map +1 -1
  211. package/resources/blocks/agents.js +5 -1
  212. package/resources/blocks/agents.js.map +1 -1
  213. package/resources/blocks/agents.mjs +5 -1
  214. package/resources/blocks/agents.mjs.map +1 -1
  215. package/resources/blocks/blocks.d.mts +108 -48
  216. package/resources/blocks/blocks.d.mts.map +1 -1
  217. package/resources/blocks/blocks.d.ts +108 -48
  218. package/resources/blocks/blocks.d.ts.map +1 -1
  219. package/resources/blocks/blocks.js +3 -8
  220. package/resources/blocks/blocks.js.map +1 -1
  221. package/resources/blocks/blocks.mjs +3 -8
  222. package/resources/blocks/blocks.mjs.map +1 -1
  223. package/resources/blocks/index.d.mts +2 -2
  224. package/resources/blocks/index.d.mts.map +1 -1
  225. package/resources/blocks/index.d.ts +2 -2
  226. package/resources/blocks/index.d.ts.map +1 -1
  227. package/resources/blocks/index.js.map +1 -1
  228. package/resources/blocks/index.mjs.map +1 -1
  229. package/resources/folders/files.d.mts +75 -97
  230. package/resources/folders/files.d.mts.map +1 -1
  231. package/resources/folders/files.d.ts +75 -97
  232. package/resources/folders/files.d.ts.map +1 -1
  233. package/resources/folders/files.js +5 -1
  234. package/resources/folders/files.js.map +1 -1
  235. package/resources/folders/files.mjs +5 -1
  236. package/resources/folders/files.mjs.map +1 -1
  237. package/resources/folders/folders.d.mts +11 -44
  238. package/resources/folders/folders.d.mts.map +1 -1
  239. package/resources/folders/folders.d.ts +11 -44
  240. package/resources/folders/folders.d.ts.map +1 -1
  241. package/resources/folders/folders.js +2 -7
  242. package/resources/folders/folders.js.map +1 -1
  243. package/resources/folders/folders.mjs +2 -7
  244. package/resources/folders/folders.mjs.map +1 -1
  245. package/resources/folders/index.d.mts +2 -2
  246. package/resources/folders/index.d.mts.map +1 -1
  247. package/resources/folders/index.d.ts +2 -2
  248. package/resources/folders/index.d.ts.map +1 -1
  249. package/resources/folders/index.js.map +1 -1
  250. package/resources/folders/index.mjs.map +1 -1
  251. package/resources/groups/groups.d.mts +17 -67
  252. package/resources/groups/groups.d.mts.map +1 -1
  253. package/resources/groups/groups.d.ts +17 -67
  254. package/resources/groups/groups.d.ts.map +1 -1
  255. package/resources/groups/groups.js +6 -28
  256. package/resources/groups/groups.js.map +1 -1
  257. package/resources/groups/groups.mjs +6 -28
  258. package/resources/groups/groups.mjs.map +1 -1
  259. package/resources/groups/index.d.mts +2 -2
  260. package/resources/groups/index.d.mts.map +1 -1
  261. package/resources/groups/index.d.ts +2 -2
  262. package/resources/groups/index.d.ts.map +1 -1
  263. package/resources/groups/index.js.map +1 -1
  264. package/resources/groups/index.mjs.map +1 -1
  265. package/resources/groups/messages.d.mts +145 -79
  266. package/resources/groups/messages.d.mts.map +1 -1
  267. package/resources/groups/messages.d.ts +145 -79
  268. package/resources/groups/messages.d.ts.map +1 -1
  269. package/resources/groups/messages.js +18 -10
  270. package/resources/groups/messages.js.map +1 -1
  271. package/resources/groups/messages.mjs +18 -10
  272. package/resources/groups/messages.mjs.map +1 -1
  273. package/resources/identities/agents.d.mts +6 -28
  274. package/resources/identities/agents.d.mts.map +1 -1
  275. package/resources/identities/agents.d.ts +6 -28
  276. package/resources/identities/agents.d.ts.map +1 -1
  277. package/resources/identities/agents.js +2 -1
  278. package/resources/identities/agents.js.map +1 -1
  279. package/resources/identities/agents.mjs +2 -1
  280. package/resources/identities/agents.mjs.map +1 -1
  281. package/resources/identities/blocks.d.mts +7 -29
  282. package/resources/identities/blocks.d.mts.map +1 -1
  283. package/resources/identities/blocks.d.ts +7 -29
  284. package/resources/identities/blocks.d.ts.map +1 -1
  285. package/resources/identities/blocks.js +2 -1
  286. package/resources/identities/blocks.js.map +1 -1
  287. package/resources/identities/blocks.mjs +2 -1
  288. package/resources/identities/blocks.mjs.map +1 -1
  289. package/resources/identities/identities.d.mts +30 -65
  290. package/resources/identities/identities.d.mts.map +1 -1
  291. package/resources/identities/identities.d.ts +30 -65
  292. package/resources/identities/identities.d.ts.map +1 -1
  293. package/resources/identities/identities.js +7 -29
  294. package/resources/identities/identities.js.map +1 -1
  295. package/resources/identities/identities.mjs +7 -29
  296. package/resources/identities/identities.mjs.map +1 -1
  297. package/resources/identities/index.d.mts +3 -3
  298. package/resources/identities/index.d.mts.map +1 -1
  299. package/resources/identities/index.d.ts +3 -3
  300. package/resources/identities/index.d.ts.map +1 -1
  301. package/resources/identities/index.js.map +1 -1
  302. package/resources/identities/index.mjs.map +1 -1
  303. package/resources/index.d.mts +13 -11
  304. package/resources/index.d.mts.map +1 -1
  305. package/resources/index.d.ts +13 -11
  306. package/resources/index.d.ts.map +1 -1
  307. package/resources/index.js +6 -2
  308. package/resources/index.js.map +1 -1
  309. package/resources/index.mjs +3 -1
  310. package/resources/index.mjs.map +1 -1
  311. package/resources/mcp-servers/index.d.mts +3 -0
  312. package/resources/mcp-servers/index.d.mts.map +1 -0
  313. package/resources/mcp-servers/index.d.ts +3 -0
  314. package/resources/mcp-servers/index.d.ts.map +1 -0
  315. package/resources/mcp-servers/index.js +9 -0
  316. package/resources/mcp-servers/index.js.map +1 -0
  317. package/resources/mcp-servers/index.mjs +4 -0
  318. package/resources/mcp-servers/index.mjs.map +1 -0
  319. package/resources/mcp-servers/mcp-servers.d.mts +349 -0
  320. package/resources/mcp-servers/mcp-servers.d.mts.map +1 -0
  321. package/resources/mcp-servers/mcp-servers.d.ts +349 -0
  322. package/resources/mcp-servers/mcp-servers.d.ts.map +1 -0
  323. package/resources/mcp-servers/mcp-servers.js +69 -0
  324. package/resources/mcp-servers/mcp-servers.js.map +1 -0
  325. package/resources/mcp-servers/mcp-servers.mjs +64 -0
  326. package/resources/mcp-servers/mcp-servers.mjs.map +1 -0
  327. package/resources/mcp-servers/tools.d.mts +42 -0
  328. package/resources/mcp-servers/tools.d.mts.map +1 -0
  329. package/resources/mcp-servers/tools.d.ts +42 -0
  330. package/resources/mcp-servers/tools.d.ts.map +1 -0
  331. package/resources/mcp-servers/tools.js +36 -0
  332. package/resources/mcp-servers/tools.js.map +1 -0
  333. package/resources/mcp-servers/tools.mjs +32 -0
  334. package/resources/mcp-servers/tools.mjs.map +1 -0
  335. package/resources/mcp-servers.d.mts +2 -0
  336. package/resources/mcp-servers.d.mts.map +1 -0
  337. package/resources/mcp-servers.d.ts +2 -0
  338. package/resources/mcp-servers.d.ts.map +1 -0
  339. package/resources/mcp-servers.js +6 -0
  340. package/resources/mcp-servers.js.map +1 -0
  341. package/resources/mcp-servers.mjs +3 -0
  342. package/resources/mcp-servers.mjs.map +1 -0
  343. package/resources/models/embeddings.d.mts +6 -2
  344. package/resources/models/embeddings.d.mts.map +1 -1
  345. package/resources/models/embeddings.d.ts +6 -2
  346. package/resources/models/embeddings.d.ts.map +1 -1
  347. package/resources/models/embeddings.js +5 -1
  348. package/resources/models/embeddings.js.map +1 -1
  349. package/resources/models/embeddings.mjs +5 -1
  350. package/resources/models/embeddings.mjs.map +1 -1
  351. package/resources/models/index.d.mts +1 -1
  352. package/resources/models/index.d.mts.map +1 -1
  353. package/resources/models/index.d.ts +1 -1
  354. package/resources/models/index.d.ts.map +1 -1
  355. package/resources/models/index.js.map +1 -1
  356. package/resources/models/index.mjs.map +1 -1
  357. package/resources/models/models.d.mts +180 -4
  358. package/resources/models/models.d.mts.map +1 -1
  359. package/resources/models/models.d.ts +180 -4
  360. package/resources/models/models.d.ts.map +1 -1
  361. package/resources/models/models.js +5 -1
  362. package/resources/models/models.js.map +1 -1
  363. package/resources/models/models.mjs +5 -1
  364. package/resources/models/models.mjs.map +1 -1
  365. package/resources/runs/index.d.mts +3 -3
  366. package/resources/runs/index.d.mts.map +1 -1
  367. package/resources/runs/index.d.ts +3 -3
  368. package/resources/runs/index.d.ts.map +1 -1
  369. package/resources/runs/index.js.map +1 -1
  370. package/resources/runs/index.mjs.map +1 -1
  371. package/resources/runs/messages.d.mts +8 -28
  372. package/resources/runs/messages.d.mts.map +1 -1
  373. package/resources/runs/messages.d.ts +8 -28
  374. package/resources/runs/messages.d.ts.map +1 -1
  375. package/resources/runs/messages.js +10 -2
  376. package/resources/runs/messages.js.map +1 -1
  377. package/resources/runs/messages.mjs +10 -2
  378. package/resources/runs/messages.mjs.map +1 -1
  379. package/resources/runs/runs.d.mts +10 -36
  380. package/resources/runs/runs.d.mts.map +1 -1
  381. package/resources/runs/runs.d.ts +10 -36
  382. package/resources/runs/runs.d.ts.map +1 -1
  383. package/resources/runs/runs.js +2 -1
  384. package/resources/runs/runs.js.map +1 -1
  385. package/resources/runs/runs.mjs +3 -2
  386. package/resources/runs/runs.mjs.map +1 -1
  387. package/resources/runs/steps.d.mts +6 -26
  388. package/resources/runs/steps.d.mts.map +1 -1
  389. package/resources/runs/steps.d.ts +6 -26
  390. package/resources/runs/steps.d.ts.map +1 -1
  391. package/resources/runs/steps.js +5 -1
  392. package/resources/runs/steps.js.map +1 -1
  393. package/resources/runs/steps.mjs +5 -1
  394. package/resources/runs/steps.mjs.map +1 -1
  395. package/resources/steps/index.d.mts +2 -2
  396. package/resources/steps/index.d.mts.map +1 -1
  397. package/resources/steps/index.d.ts +2 -2
  398. package/resources/steps/index.d.ts.map +1 -1
  399. package/resources/steps/index.js.map +1 -1
  400. package/resources/steps/index.mjs +1 -1
  401. package/resources/steps/index.mjs.map +1 -1
  402. package/resources/steps/messages.d.mts +14 -28
  403. package/resources/steps/messages.d.mts.map +1 -1
  404. package/resources/steps/messages.d.ts +14 -28
  405. package/resources/steps/messages.d.ts.map +1 -1
  406. package/resources/steps/messages.js +5 -1
  407. package/resources/steps/messages.js.map +1 -1
  408. package/resources/steps/messages.mjs +5 -1
  409. package/resources/steps/messages.mjs.map +1 -1
  410. package/resources/steps/steps.d.mts +17 -44
  411. package/resources/steps/steps.d.mts.map +1 -1
  412. package/resources/steps/steps.d.ts +17 -44
  413. package/resources/steps/steps.d.ts.map +1 -1
  414. package/resources/steps/steps.js +3 -11
  415. package/resources/steps/steps.js.map +1 -1
  416. package/resources/steps/steps.mjs +3 -11
  417. package/resources/steps/steps.mjs.map +1 -1
  418. package/resources/templates/agents.d.mts +9 -14
  419. package/resources/templates/agents.d.mts.map +1 -1
  420. package/resources/templates/agents.d.ts +9 -14
  421. package/resources/templates/agents.d.ts.map +1 -1
  422. package/resources/templates/agents.js +2 -3
  423. package/resources/templates/agents.js.map +1 -1
  424. package/resources/templates/agents.mjs +2 -3
  425. package/resources/templates/agents.mjs.map +1 -1
  426. package/resources/tools.d.mts +6 -68
  427. package/resources/tools.d.mts.map +1 -1
  428. package/resources/tools.d.ts +6 -68
  429. package/resources/tools.d.ts.map +1 -1
  430. package/resources/tools.js +2 -7
  431. package/resources/tools.js.map +1 -1
  432. package/resources/tools.mjs +2 -7
  433. package/resources/tools.mjs.map +1 -1
  434. package/src/client.ts +274 -127
  435. package/src/core/pagination.ts +334 -0
  436. package/src/core/streaming.ts +331 -0
  437. package/src/index.ts +1 -0
  438. package/src/internal/decoders/line.ts +135 -0
  439. package/src/internal/parse.ts +14 -0
  440. package/src/internal/request-options.ts +2 -0
  441. package/src/pagination.ts +2 -0
  442. package/src/resources/access-tokens.ts +163 -0
  443. package/src/resources/agents/agents.ts +722 -242
  444. package/src/resources/agents/archives.ts +51 -0
  445. package/src/resources/agents/blocks.ts +50 -63
  446. package/src/resources/agents/files.ts +47 -90
  447. package/src/resources/agents/folders.ts +58 -88
  448. package/src/resources/agents/groups.ts +11 -35
  449. package/src/resources/agents/identities.ts +51 -0
  450. package/src/resources/agents/index.ts +40 -12
  451. package/src/resources/agents/messages.ts +911 -552
  452. package/src/resources/agents/tools.ts +13 -37
  453. package/src/resources/archives/archives.ts +170 -0
  454. package/src/resources/archives/index.ts +17 -0
  455. package/src/resources/archives/passages.ts +150 -0
  456. package/src/resources/archives.ts +1 -178
  457. package/src/resources/batches/batches.ts +74 -46
  458. package/src/resources/batches/index.ts +2 -2
  459. package/src/resources/batches/messages.ts +12 -37
  460. package/src/resources/blocks/agents.ts +11 -35
  461. package/src/resources/blocks/blocks.ts +130 -64
  462. package/src/resources/blocks/index.ts +3 -3
  463. package/src/resources/folders/files.ts +90 -113
  464. package/src/resources/folders/folders.ts +14 -55
  465. package/src/resources/folders/index.ts +2 -2
  466. package/src/resources/groups/groups.ts +21 -102
  467. package/src/resources/groups/index.ts +2 -4
  468. package/src/resources/groups/messages.ts +215 -103
  469. package/src/resources/identities/agents.ts +12 -35
  470. package/src/resources/identities/blocks.ts +13 -36
  471. package/src/resources/identities/identities.ts +35 -107
  472. package/src/resources/identities/index.ts +3 -4
  473. package/src/resources/index.ts +55 -18
  474. package/src/resources/mcp-servers/index.ts +25 -0
  475. package/src/resources/mcp-servers/mcp-servers.ts +460 -0
  476. package/src/resources/mcp-servers/tools.ts +69 -0
  477. package/src/resources/mcp-servers.ts +3 -0
  478. package/src/resources/models/embeddings.ts +6 -2
  479. package/src/resources/models/index.ts +2 -0
  480. package/src/resources/models/models.ts +260 -3
  481. package/src/resources/runs/index.ts +2 -3
  482. package/src/resources/runs/messages.ts +18 -37
  483. package/src/resources/runs/runs.ts +14 -54
  484. package/src/resources/runs/steps.ts +11 -33
  485. package/src/resources/steps/index.ts +7 -2
  486. package/src/resources/steps/messages.ts +25 -35
  487. package/src/resources/steps/steps.ts +20 -61
  488. package/src/resources/templates/agents.ts +14 -17
  489. package/src/resources/tools.ts +8 -92
  490. package/src/streaming.ts +2 -0
  491. package/src/version.ts +1 -1
  492. package/streaming.d.mts +2 -0
  493. package/streaming.d.mts.map +1 -0
  494. package/streaming.d.ts +2 -0
  495. package/streaming.d.ts.map +1 -0
  496. package/streaming.js +6 -0
  497. package/streaming.js.map +1 -0
  498. package/streaming.mjs +2 -0
  499. package/streaming.mjs.map +1 -0
  500. package/version.d.mts +1 -1
  501. package/version.d.mts.map +1 -1
  502. package/version.d.ts +1 -1
  503. package/version.d.ts.map +1 -1
  504. package/version.js +1 -1
  505. package/version.js.map +1 -1
  506. package/version.mjs +1 -1
  507. package/version.mjs.map +1 -1
@@ -6,21 +6,54 @@ import * as ToolsAPI from '../tools';
6
6
  import * as AgentsAPI from './agents';
7
7
  import * as RunsAPI from '../runs/runs';
8
8
  import { APIPromise } from '../../core/api-promise';
9
+ import { ArrayPage, type ArrayPageParams, ObjectPage, PagePromise } from '../../core/pagination';
10
+ import { Stream } from '../../core/streaming';
9
11
  import { buildHeaders } from '../../internal/headers';
10
12
  import { RequestOptions } from '../../internal/request-options';
11
13
  import { path } from '../../internal/utils/path';
12
14
 
13
15
  export class Messages extends APIResource {
14
16
  /**
15
- * Update the details of a message associated with an agent.
17
+ * Process a user message and return the agent's response. This endpoint accepts a
18
+ * message from a user and processes it through the agent.
19
+ *
20
+ * The response format is controlled by the `streaming` field in the request body:
21
+ *
22
+ * - If `streaming=false` (default): Returns a complete LettaResponse with all
23
+ * messages
24
+ * - If `streaming=true`: Returns a Server-Sent Events (SSE) stream
25
+ *
26
+ * Additional streaming options (only used when streaming=true):
27
+ *
28
+ * - `stream_tokens`: Stream individual tokens instead of complete steps
29
+ * - `include_pings`: Include keepalive pings to prevent connection timeouts
30
+ * - `background`: Process the request in the background
16
31
  */
17
- update(
18
- messageID: string,
19
- params: MessageUpdateParams,
32
+ create(
33
+ agentID: string,
34
+ body: MessageCreateParamsNonStreaming,
35
+ options?: RequestOptions,
36
+ ): APIPromise<LettaResponse>;
37
+ create(
38
+ agentID: string,
39
+ body: MessageCreateParamsStreaming,
40
+ options?: RequestOptions,
41
+ ): APIPromise<Stream<LettaStreamingResponse>>;
42
+ create(
43
+ agentID: string,
44
+ body: MessageCreateParamsBase,
45
+ options?: RequestOptions,
46
+ ): APIPromise<Stream<LettaStreamingResponse> | LettaResponse>;
47
+ create(
48
+ agentID: string,
49
+ body: MessageCreateParams,
20
50
  options?: RequestOptions,
21
- ): APIPromise<MessageUpdateResponse> {
22
- const { agent_id, ...body } = params;
23
- return this._client.patch(path`/v1/agents/${agent_id}/messages/${messageID}`, { body, ...options });
51
+ ): APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>> {
52
+ return this._client.post(path`/v1/agents/${agentID}/messages`, {
53
+ body,
54
+ ...options,
55
+ stream: body.streaming ?? false,
56
+ }) as APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>>;
24
57
  }
25
58
 
26
59
  /**
@@ -30,8 +63,11 @@ export class Messages extends APIResource {
30
63
  agentID: string,
31
64
  query: MessageListParams | null | undefined = {},
32
65
  options?: RequestOptions,
33
- ): APIPromise<MessageListResponse> {
34
- return this._client.get(path`/v1/agents/${agentID}/messages`, { query, ...options });
66
+ ): PagePromise<MessagesArrayPage, Message> {
67
+ return this._client.getAPIList(path`/v1/agents/${agentID}/messages`, ArrayPage<Message>, {
68
+ query,
69
+ ...options,
70
+ });
35
71
  }
36
72
 
37
73
  /**
@@ -49,22 +85,13 @@ export class Messages extends APIResource {
49
85
  }
50
86
 
51
87
  /**
52
- * Resets the messages for an agent
53
- */
54
- reset(
55
- agentID: string,
56
- body: MessageResetParams,
57
- options?: RequestOptions,
58
- ): APIPromise<AgentsAPI.AgentState> {
59
- return this._client.patch(path`/v1/agents/${agentID}/reset-messages`, { body, ...options });
60
- }
61
-
62
- /**
63
- * Process a user message and return the agent's response. This endpoint accepts a
64
- * message from a user and processes it through the agent.
88
+ * Summarize an agent's conversation history.
65
89
  */
66
- send(agentID: string, body: MessageSendParams, options?: RequestOptions): APIPromise<LettaResponse> {
67
- return this._client.post(path`/v1/agents/${agentID}/messages`, { body, ...options });
90
+ compact(agentID: string, options?: RequestOptions): APIPromise<void> {
91
+ return this._client.post(path`/v1/agents/${agentID}/summarize`, {
92
+ ...options,
93
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
94
+ });
68
95
  }
69
96
 
70
97
  /**
@@ -75,30 +102,45 @@ export class Messages extends APIResource {
75
102
  * This is "asynchronous" in the sense that it's a background run and explicitly
76
103
  * must be fetched by the run ID.
77
104
  */
78
- sendAsync(agentID: string, body: MessageSendAsyncParams, options?: RequestOptions): APIPromise<Run> {
105
+ createAsync(agentID: string, body: MessageCreateAsyncParams, options?: RequestOptions): APIPromise<Run> {
79
106
  return this._client.post(path`/v1/agents/${agentID}/messages/async`, { body, ...options });
80
107
  }
81
108
 
82
109
  /**
83
- * Process a user message and return the agent's response. This endpoint accepts a
84
- * message from a user and processes it through the agent. It will stream the steps
85
- * of the response always, and stream the tokens if 'stream_tokens' is set to True.
110
+ * Resets the messages for an agent
86
111
  */
87
- stream(agentID: string, body: MessageStreamParams, options?: RequestOptions): APIPromise<unknown> {
88
- return this._client.post(path`/v1/agents/${agentID}/messages/stream`, { body, ...options });
112
+ reset(
113
+ agentID: string,
114
+ body: MessageResetParams,
115
+ options?: RequestOptions,
116
+ ): APIPromise<AgentsAPI.AgentState | null> {
117
+ return this._client.patch(path`/v1/agents/${agentID}/reset-messages`, { body, ...options });
89
118
  }
90
119
 
91
120
  /**
92
- * Summarize an agent's conversation history.
121
+ * Process a user message and return the agent's response. This endpoint accepts a
122
+ * message from a user and processes it through the agent. It will stream the steps
123
+ * of the response always, and stream the tokens if 'stream_tokens' is set to True.
93
124
  */
94
- summarize(agentID: string, options?: RequestOptions): APIPromise<void> {
95
- return this._client.post(path`/v1/agents/${agentID}/summarize`, {
125
+ stream(
126
+ agentID: string,
127
+ body: MessageStreamParams,
128
+ options?: RequestOptions,
129
+ ): APIPromise<Stream<LettaStreamingResponse>> {
130
+ return this._client.post(path`/v1/agents/${agentID}/messages/stream`, {
131
+ body,
96
132
  ...options,
97
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
98
- });
133
+ stream: true,
134
+ }) as APIPromise<Stream<LettaStreamingResponse>>;
99
135
  }
100
136
  }
101
137
 
138
+ export type MessagesArrayPage = ArrayPage<Message>;
139
+
140
+ export type RunsArrayPage = ArrayPage<Run>;
141
+
142
+ export type InternalMessagesObjectPage = ObjectPage<InternalMessage>;
143
+
102
144
  /**
103
145
  * Input to approve or deny a tool call request
104
146
  */
@@ -111,13 +153,18 @@ export interface ApprovalCreate {
111
153
  /**
112
154
  * The list of approval responses
113
155
  */
114
- approvals?: Array<ApprovalCreate.ApprovalReturn | ToolReturn> | null;
156
+ approvals?: Array<ApprovalReturn | ToolReturn> | null;
115
157
 
116
158
  /**
117
159
  * @deprecated Whether the tool has been approved
118
160
  */
119
161
  approve?: boolean | null;
120
162
 
163
+ /**
164
+ * The multi-agent group that the message was sent in
165
+ */
166
+ group_id?: string | null;
167
+
121
168
  /**
122
169
  * @deprecated An optional explanation for the provided approval status
123
170
  */
@@ -129,30 +176,6 @@ export interface ApprovalCreate {
129
176
  type?: 'approval';
130
177
  }
131
178
 
132
- export namespace ApprovalCreate {
133
- export interface ApprovalReturn {
134
- /**
135
- * Whether the tool has been approved
136
- */
137
- approve: boolean;
138
-
139
- /**
140
- * The ID of the tool call that corresponds to this approval
141
- */
142
- tool_call_id: string;
143
-
144
- /**
145
- * An optional explanation for the provided approval status
146
- */
147
- reason?: string | null;
148
-
149
- /**
150
- * The message type to be created.
151
- */
152
- type?: 'approval';
153
- }
154
- }
155
-
156
179
  /**
157
180
  * A message representing a request for approval to call a tool (generated by the
158
181
  * LLM to trigger tool execution).
@@ -220,7 +243,7 @@ export interface ApprovalResponseMessage {
220
243
  /**
221
244
  * The list of approval responses
222
245
  */
223
- approvals?: Array<ApprovalResponseMessage.ApprovalReturn | ToolReturn> | null;
246
+ approvals?: Array<ApprovalReturn | ToolReturn> | null;
224
247
 
225
248
  /**
226
249
  * @deprecated Whether the tool has been approved
@@ -252,28 +275,26 @@ export interface ApprovalResponseMessage {
252
275
  step_id?: string | null;
253
276
  }
254
277
 
255
- export namespace ApprovalResponseMessage {
256
- export interface ApprovalReturn {
257
- /**
258
- * Whether the tool has been approved
259
- */
260
- approve: boolean;
278
+ export interface ApprovalReturn {
279
+ /**
280
+ * Whether the tool has been approved
281
+ */
282
+ approve: boolean;
261
283
 
262
- /**
263
- * The ID of the tool call that corresponds to this approval
264
- */
265
- tool_call_id: string;
284
+ /**
285
+ * The ID of the tool call that corresponds to this approval
286
+ */
287
+ tool_call_id: string;
266
288
 
267
- /**
268
- * An optional explanation for the provided approval status
269
- */
270
- reason?: string | null;
289
+ /**
290
+ * An optional explanation for the provided approval status
291
+ */
292
+ reason?: string | null;
271
293
 
272
- /**
273
- * The message type to be created.
274
- */
275
- type?: 'approval';
276
- }
294
+ /**
295
+ * The message type to be created.
296
+ */
297
+ type?: 'approval';
277
298
  }
278
299
 
279
300
  /**
@@ -315,6 +336,36 @@ export interface AssistantMessage {
315
336
  step_id?: string | null;
316
337
  }
317
338
 
339
+ /**
340
+ * A message for notifying the developer that an event that has occured (e.g. a
341
+ * compaction). Events are NOT part of the context window.
342
+ */
343
+ export interface EventMessage {
344
+ id: string;
345
+
346
+ date: string;
347
+
348
+ event_data: { [key: string]: unknown };
349
+
350
+ event_type: 'compaction';
351
+
352
+ is_err?: boolean | null;
353
+
354
+ message_type?: 'event';
355
+
356
+ name?: string | null;
357
+
358
+ otid?: string | null;
359
+
360
+ run_id?: string | null;
361
+
362
+ sender_id?: string | null;
363
+
364
+ seq_id?: number | null;
365
+
366
+ step_id?: string | null;
367
+ }
368
+
318
369
  /**
319
370
  * Representation of an agent's internal reasoning where reasoning content has been
320
371
  * hidden from the response.
@@ -432,173 +483,300 @@ export namespace ImageContent {
432
483
  }
433
484
 
434
485
  /**
435
- * Status of the job.
486
+ * Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
487
+ *
488
+ * Attributes:
489
+ * id (str): The unique identifier of the message.
490
+ * role (MessageRole): The role of the participant.
491
+ * text (str): The text of the message.
492
+ * user_id (str): The unique identifier of the user.
493
+ * agent_id (str): The unique identifier of the agent.
494
+ * model (str): The model used to make the function call.
495
+ * name (str): The name of the participant.
496
+ * created_at (datetime): The time the message was created.
497
+ * tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
498
+ * tool_call_id (str): The id of the tool call.
499
+ * step_id (str): The id of the step that this message was created in.
500
+ * otid (str): The offline threading id associated with this message.
501
+ * tool_returns (List[ToolReturn]): The list of tool returns requested.
502
+ * group_id (str): The multi-agent group that the message was sent in.
503
+ * sender_id (str): The id of the sender of the message, can be an identity id or agent id.
504
+ *
505
+ * t
436
506
  */
437
- export type JobStatus = 'created' | 'running' | 'completed' | 'failed' | 'pending' | 'cancelled' | 'expired';
438
-
439
- export type JobType = 'job' | 'run' | 'batch';
507
+ export interface InternalMessage {
508
+ /**
509
+ * The human-friendly ID of the Message
510
+ */
511
+ id: string;
440
512
 
441
- export interface LettaAssistantMessageContentUnion {
442
513
  /**
443
- * The text content of the message.
514
+ * The role of the participant.
444
515
  */
445
- text: string;
516
+ role: MessageRole;
446
517
 
447
518
  /**
448
- * Stores a unique identifier for any reasoning associated with this text content.
519
+ * The unique identifier of the agent.
449
520
  */
450
- signature?: string | null;
521
+ agent_id?: string | null;
451
522
 
452
523
  /**
453
- * The type of the message.
524
+ * The id of the approval request if this message is associated with a tool call
525
+ * request.
454
526
  */
455
- type?: 'text';
456
- }
527
+ approval_request_id?: string | null;
457
528
 
458
- /**
459
- * A message generated by the system. Never streamed back on a response, only used
460
- * for cursor pagination.
461
- *
462
- * Args: id (str): The ID of the message date (datetime): The date the message was
463
- * created in ISO format name (Optional[str]): The name of the sender of the
464
- * message content (str): The message content sent by the system
465
- */
466
- export type LettaMessageUnion =
467
- | SystemMessage
468
- | UserMessage
469
- | ReasoningMessage
470
- | HiddenReasoningMessage
471
- | ToolCallMessage
472
- | ToolsAPI.ToolReturnMessage
473
- | AssistantMessage
474
- | ApprovalRequestMessage
475
- | ApprovalResponseMessage;
529
+ /**
530
+ * The list of approvals for this message.
531
+ */
532
+ approvals?: Array<ApprovalReturn | InternalMessage.LettaSchemasMessageToolReturn> | null;
476
533
 
477
- export interface LettaRequest {
478
534
  /**
479
- * The messages to be sent to the agent.
535
+ * Whether tool call is approved.
480
536
  */
481
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
537
+ approve?: boolean | null;
482
538
 
483
539
  /**
484
- * @deprecated The name of the message argument in the designated message tool.
485
- * Still supported for legacy agent types, but deprecated for letta_v1_agent
486
- * onward.
540
+ * The id of the LLMBatchItem that this message is associated with
487
541
  */
488
- assistant_message_tool_kwarg?: string;
542
+ batch_item_id?: string | null;
489
543
 
490
544
  /**
491
- * @deprecated The name of the designated message tool. Still supported for legacy
492
- * agent types, but deprecated for letta_v1_agent onward.
545
+ * The content of the message.
493
546
  */
494
- assistant_message_tool_name?: string;
547
+ content?: Array<
548
+ | TextContent
549
+ | ImageContent
550
+ | ToolCallContent
551
+ | ToolReturnContent
552
+ | ReasoningContent
553
+ | RedactedReasoningContent
554
+ | OmittedReasoningContent
555
+ | InternalMessage.SummarizedReasoningContent
556
+ > | null;
495
557
 
496
558
  /**
497
- * @deprecated If set to True, enables reasoning before responses or tool calls
498
- * from the agent.
559
+ * The timestamp when the object was created.
499
560
  */
500
- enable_thinking?: string;
561
+ created_at?: string;
501
562
 
502
563
  /**
503
- * Only return specified message types in the response. If `None` (default) returns
504
- * all messages.
564
+ * The id of the user that made this object.
505
565
  */
506
- include_return_message_types?: Array<MessageType> | null;
566
+ created_by_id?: string | null;
507
567
 
508
568
  /**
509
- * Maximum number of steps the agent should take to process the request.
569
+ * The reason the tool call request was denied.
510
570
  */
511
- max_steps?: number;
571
+ denial_reason?: string | null;
512
572
 
513
573
  /**
514
- * @deprecated Whether the server should parse specific tool call arguments
515
- * (default `send_message`) as `AssistantMessage` objects. Still supported for
516
- * legacy agent types, but deprecated for letta_v1_agent onward.
574
+ * The multi-agent group that the message was sent in
517
575
  */
518
- use_assistant_message?: boolean;
519
- }
576
+ group_id?: string | null;
520
577
 
521
- /**
522
- * Response object from an agent interaction, consisting of the new messages
523
- * generated by the agent and usage statistics. The type of the returned messages
524
- * can be either `Message` or `LettaMessage`, depending on what was specified in
525
- * the request.
526
- *
527
- * Attributes: messages (List[Union[Message, LettaMessage]]): The messages returned
528
- * by the agent. usage (LettaUsageStatistics): The usage statistics
529
- */
530
- export interface LettaResponse {
531
578
  /**
532
- * The messages returned by the agent.
579
+ * Whether this message is part of an error step. Used only for debugging purposes.
533
580
  */
534
- messages: Array<LettaMessageUnion>;
581
+ is_err?: boolean | null;
535
582
 
536
583
  /**
537
- * The stop reason from Letta indicating why agent loop stopped execution.
584
+ * The id of the user that made this object.
538
585
  */
539
- stop_reason: LettaResponse.StopReason;
586
+ last_updated_by_id?: string | null;
540
587
 
541
588
  /**
542
- * The usage statistics of the agent.
589
+ * The model used to make the function call.
543
590
  */
544
- usage: LettaResponse.Usage;
545
- }
591
+ model?: string | null;
546
592
 
547
- export namespace LettaResponse {
548
593
  /**
549
- * The stop reason from Letta indicating why agent loop stopped execution.
594
+ * For role user/assistant: the (optional) name of the participant. For role
595
+ * tool/function: the name of the function called.
550
596
  */
551
- export interface StopReason {
552
- /**
553
- * The reason why execution stopped.
554
- */
555
- stop_reason: RunsAPI.StopReasonType;
597
+ name?: string | null;
556
598
 
599
+ /**
600
+ * The offline threading id associated with this message
601
+ */
602
+ otid?: string | null;
603
+
604
+ /**
605
+ * The id of the run that this message was created in.
606
+ */
607
+ run_id?: string | null;
608
+
609
+ /**
610
+ * The id of the sender of the message, can be an identity id or agent id
611
+ */
612
+ sender_id?: string | null;
613
+
614
+ /**
615
+ * The id of the step that this message was created in.
616
+ */
617
+ step_id?: string | null;
618
+
619
+ /**
620
+ * The ID of the tool call. Only applicable for role tool.
621
+ */
622
+ tool_call_id?: string | null;
623
+
624
+ /**
625
+ * The list of tool calls requested. Only applicable for role assistant.
626
+ */
627
+ tool_calls?: Array<InternalMessage.ToolCall> | null;
628
+
629
+ /**
630
+ * Tool execution return information for prior tool calls
631
+ */
632
+ tool_returns?: Array<InternalMessage.ToolReturn> | null;
633
+
634
+ /**
635
+ * The timestamp when the object was last updated.
636
+ */
637
+ updated_at?: string | null;
638
+ }
639
+
640
+ export namespace InternalMessage {
641
+ export interface LettaSchemasMessageToolReturn {
557
642
  /**
558
- * The type of the message.
643
+ * The status of the tool call
559
644
  */
560
- message_type?: 'stop_reason';
645
+ status: 'success' | 'error';
646
+
647
+ /**
648
+ * The function response string
649
+ */
650
+ func_response?: string | null;
651
+
652
+ /**
653
+ * Captured stderr from the tool invocation
654
+ */
655
+ stderr?: Array<string> | null;
656
+
657
+ /**
658
+ * Captured stdout (e.g. prints, logs) from the tool invocation
659
+ */
660
+ stdout?: Array<string> | null;
661
+
662
+ /**
663
+ * The ID for the tool call
664
+ */
665
+ tool_call_id?: unknown;
561
666
  }
562
667
 
563
668
  /**
564
- * The usage statistics of the agent.
669
+ * The style of reasoning content returned by the OpenAI Responses API
565
670
  */
566
- export interface Usage {
671
+ export interface SummarizedReasoningContent {
567
672
  /**
568
- * The number of tokens generated by the agent.
673
+ * The unique identifier for this reasoning step.
569
674
  */
570
- completion_tokens?: number;
675
+ id: string;
571
676
 
572
- message_type?: 'usage_statistics';
677
+ /**
678
+ * Summaries of the reasoning content.
679
+ */
680
+ summary: Array<SummarizedReasoningContent.Summary>;
573
681
 
574
682
  /**
575
- * The number of tokens in the prompt.
683
+ * The encrypted reasoning content.
576
684
  */
577
- prompt_tokens?: number;
685
+ encrypted_content?: string;
578
686
 
579
687
  /**
580
- * The background task run IDs associated with the agent interaction
688
+ * Indicates this is a summarized reasoning step.
581
689
  */
582
- run_ids?: Array<string> | null;
690
+ type?: 'summarized_reasoning';
691
+ }
692
+
693
+ export namespace SummarizedReasoningContent {
694
+ export interface Summary {
695
+ /**
696
+ * The index of the summary part.
697
+ */
698
+ index: number;
699
+
700
+ /**
701
+ * The text of the summary part.
702
+ */
703
+ text: string;
704
+ }
705
+ }
706
+
707
+ export interface ToolCall {
708
+ id: string;
709
+
710
+ function: ToolCall.Function;
583
711
 
712
+ type: 'function';
713
+
714
+ [k: string]: unknown;
715
+ }
716
+
717
+ export namespace ToolCall {
718
+ export interface Function {
719
+ arguments: string;
720
+
721
+ name: string;
722
+
723
+ [k: string]: unknown;
724
+ }
725
+ }
726
+
727
+ export interface ToolReturn {
584
728
  /**
585
- * The number of steps taken by the agent.
729
+ * The status of the tool call
586
730
  */
587
- step_count?: number;
731
+ status: 'success' | 'error';
588
732
 
589
733
  /**
590
- * The total number of tokens processed by the agent.
734
+ * The function response string
591
735
  */
592
- total_tokens?: number;
736
+ func_response?: string | null;
737
+
738
+ /**
739
+ * Captured stderr from the tool invocation
740
+ */
741
+ stderr?: Array<string> | null;
742
+
743
+ /**
744
+ * Captured stdout (e.g. prints, logs) from the tool invocation
745
+ */
746
+ stdout?: Array<string> | null;
747
+
748
+ /**
749
+ * The ID for the tool call
750
+ */
751
+ tool_call_id?: unknown;
593
752
  }
594
753
  }
595
754
 
596
- export interface LettaStreamingRequest {
755
+ /**
756
+ * Status of the job.
757
+ */
758
+ export type JobStatus = 'created' | 'running' | 'completed' | 'failed' | 'pending' | 'cancelled' | 'expired';
759
+
760
+ export type JobType = 'job' | 'run' | 'batch';
761
+
762
+ export interface LettaAssistantMessageContentUnion {
597
763
  /**
598
- * The messages to be sent to the agent.
764
+ * The text content of the message.
765
+ */
766
+ text: string;
767
+
768
+ /**
769
+ * Stores a unique identifier for any reasoning associated with this text content.
599
770
  */
600
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
771
+ signature?: string | null;
601
772
 
773
+ /**
774
+ * The type of the message.
775
+ */
776
+ type?: 'text';
777
+ }
778
+
779
+ export interface LettaRequest {
602
780
  /**
603
781
  * @deprecated The name of the message argument in the designated message tool.
604
782
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -612,39 +790,45 @@ export interface LettaStreamingRequest {
612
790
  */
613
791
  assistant_message_tool_name?: string;
614
792
 
615
- /**
616
- * Whether to process the request in the background.
617
- */
618
- background?: boolean;
619
-
620
793
  /**
621
794
  * @deprecated If set to True, enables reasoning before responses or tool calls
622
795
  * from the agent.
623
796
  */
624
797
  enable_thinking?: string;
625
798
 
626
- /**
627
- * Whether to include periodic keepalive ping messages in the stream to prevent
628
- * connection timeouts.
629
- */
630
- include_pings?: boolean;
631
-
632
799
  /**
633
800
  * Only return specified message types in the response. If `None` (default) returns
634
801
  * all messages.
635
802
  */
636
803
  include_return_message_types?: Array<MessageType> | null;
637
804
 
805
+ /**
806
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
807
+ * 'user', 'content': input}].
808
+ */
809
+ input?:
810
+ | string
811
+ | Array<
812
+ | TextContent
813
+ | ImageContent
814
+ | ToolCallContent
815
+ | ToolReturnContent
816
+ | ReasoningContent
817
+ | RedactedReasoningContent
818
+ | OmittedReasoningContent
819
+ | LettaRequest.SummarizedReasoningContent
820
+ >
821
+ | null;
822
+
638
823
  /**
639
824
  * Maximum number of steps the agent should take to process the request.
640
825
  */
641
826
  max_steps?: number;
642
827
 
643
828
  /**
644
- * Flag to determine if individual tokens should be streamed, rather than streaming
645
- * per step.
829
+ * The messages to be sent to the agent.
646
830
  */
647
- stream_tokens?: boolean;
831
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
648
832
 
649
833
  /**
650
834
  * @deprecated Whether the server should parse specific tool call arguments
@@ -654,213 +838,209 @@ export interface LettaStreamingRequest {
654
838
  use_assistant_message?: boolean;
655
839
  }
656
840
 
657
- export type LettaUserMessageContentUnion = TextContent | ImageContent;
841
+ export namespace LettaRequest {
842
+ /**
843
+ * The style of reasoning content returned by the OpenAI Responses API
844
+ */
845
+ export interface SummarizedReasoningContent {
846
+ /**
847
+ * The unique identifier for this reasoning step.
848
+ */
849
+ id: string;
850
+
851
+ /**
852
+ * Summaries of the reasoning content.
853
+ */
854
+ summary: Array<SummarizedReasoningContent.Summary>;
855
+
856
+ /**
857
+ * The encrypted reasoning content.
858
+ */
859
+ encrypted_content?: string;
860
+
861
+ /**
862
+ * Indicates this is a summarized reasoning step.
863
+ */
864
+ type?: 'summarized_reasoning';
865
+ }
866
+
867
+ export namespace SummarizedReasoningContent {
868
+ export interface Summary {
869
+ /**
870
+ * The index of the summary part.
871
+ */
872
+ index: number;
873
+
874
+ /**
875
+ * The text of the summary part.
876
+ */
877
+ text: string;
878
+ }
879
+ }
880
+ }
658
881
 
659
882
  /**
660
- * Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
661
- *
662
- * Attributes:
663
- * id (str): The unique identifier of the message.
664
- * role (MessageRole): The role of the participant.
665
- * text (str): The text of the message.
666
- * user_id (str): The unique identifier of the user.
667
- * agent_id (str): The unique identifier of the agent.
668
- * model (str): The model used to make the function call.
669
- * name (str): The name of the participant.
670
- * created_at (datetime): The time the message was created.
671
- * tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
672
- * tool_call_id (str): The id of the tool call.
673
- * step_id (str): The id of the step that this message was created in.
674
- * otid (str): The offline threading id associated with this message.
675
- * tool_returns (List[ToolReturn]): The list of tool returns requested.
676
- * group_id (str): The multi-agent group that the message was sent in.
677
- * sender_id (str): The id of the sender of the message, can be an identity id or agent id.
883
+ * Response object from an agent interaction, consisting of the new messages
884
+ * generated by the agent and usage statistics. The type of the returned messages
885
+ * can be either `Message` or `LettaMessage`, depending on what was specified in
886
+ * the request.
678
887
  *
679
- * t
888
+ * Attributes: messages (List[Union[Message, LettaMessage]]): The messages returned
889
+ * by the agent. usage (LettaUsageStatistics): The usage statistics
680
890
  */
681
- export interface Message {
682
- /**
683
- * The role of the participant.
684
- */
685
- role: MessageRole;
686
-
891
+ export interface LettaResponse {
687
892
  /**
688
- * The human-friendly ID of the Message
893
+ * The messages returned by the agent.
689
894
  */
690
- id?: string;
895
+ messages: Array<Message>;
691
896
 
692
897
  /**
693
- * The unique identifier of the agent.
898
+ * The stop reason from Letta indicating why agent loop stopped execution.
694
899
  */
695
- agent_id?: string | null;
900
+ stop_reason: LettaResponse.StopReason;
696
901
 
697
902
  /**
698
- * The id of the approval request if this message is associated with a tool call
699
- * request.
903
+ * The usage statistics of the agent.
700
904
  */
701
- approval_request_id?: string | null;
905
+ usage: LettaResponse.Usage;
906
+ }
702
907
 
908
+ export namespace LettaResponse {
703
909
  /**
704
- * The list of approvals for this message.
910
+ * The stop reason from Letta indicating why agent loop stopped execution.
705
911
  */
706
- approvals?: Array<Message.ApprovalReturn | Message.LettaSchemasMessageToolReturn> | null;
912
+ export interface StopReason {
913
+ /**
914
+ * The reason why execution stopped.
915
+ */
916
+ stop_reason: RunsAPI.StopReasonType;
707
917
 
708
- /**
709
- * Whether tool call is approved.
710
- */
711
- approve?: boolean | null;
918
+ /**
919
+ * The type of the message.
920
+ */
921
+ message_type?: 'stop_reason';
922
+ }
712
923
 
713
924
  /**
714
- * The id of the LLMBatchItem that this message is associated with
925
+ * The usage statistics of the agent.
715
926
  */
716
- batch_item_id?: string | null;
927
+ export interface Usage {
928
+ /**
929
+ * The number of tokens generated by the agent.
930
+ */
931
+ completion_tokens?: number;
717
932
 
718
- /**
719
- * The content of the message.
720
- */
721
- content?: Array<
722
- | TextContent
723
- | ImageContent
724
- | ToolCallContent
725
- | ToolReturnContent
726
- | ReasoningContent
727
- | RedactedReasoningContent
728
- | OmittedReasoningContent
729
- | Message.SummarizedReasoningContent
730
- > | null;
933
+ message_type?: 'usage_statistics';
731
934
 
732
- /**
733
- * The timestamp when the object was created.
734
- */
735
- created_at?: string;
935
+ /**
936
+ * The number of tokens in the prompt.
937
+ */
938
+ prompt_tokens?: number;
736
939
 
737
- /**
738
- * The id of the user that made this object.
739
- */
740
- created_by_id?: string | null;
940
+ /**
941
+ * The background task run IDs associated with the agent interaction
942
+ */
943
+ run_ids?: Array<string> | null;
741
944
 
742
- /**
743
- * The reason the tool call request was denied.
744
- */
745
- denial_reason?: string | null;
945
+ /**
946
+ * The number of steps taken by the agent.
947
+ */
948
+ step_count?: number;
746
949
 
747
- /**
748
- * The multi-agent group that the message was sent in
749
- */
750
- group_id?: string | null;
950
+ /**
951
+ * The total number of tokens processed by the agent.
952
+ */
953
+ total_tokens?: number;
954
+ }
955
+ }
751
956
 
957
+ export interface LettaStreamingRequest {
752
958
  /**
753
- * Whether this message is part of an error step. Used only for debugging purposes.
959
+ * @deprecated The name of the message argument in the designated message tool.
960
+ * Still supported for legacy agent types, but deprecated for letta_v1_agent
961
+ * onward.
754
962
  */
755
- is_err?: boolean | null;
963
+ assistant_message_tool_kwarg?: string;
756
964
 
757
965
  /**
758
- * The id of the user that made this object.
966
+ * @deprecated The name of the designated message tool. Still supported for legacy
967
+ * agent types, but deprecated for letta_v1_agent onward.
759
968
  */
760
- last_updated_by_id?: string | null;
969
+ assistant_message_tool_name?: string;
761
970
 
762
971
  /**
763
- * The model used to make the function call.
972
+ * Whether to process the request in the background (only used when
973
+ * streaming=true).
764
974
  */
765
- model?: string | null;
975
+ background?: boolean;
766
976
 
767
977
  /**
768
- * For role user/assistant: the (optional) name of the participant. For role
769
- * tool/function: the name of the function called.
978
+ * @deprecated If set to True, enables reasoning before responses or tool calls
979
+ * from the agent.
770
980
  */
771
- name?: string | null;
981
+ enable_thinking?: string;
772
982
 
773
983
  /**
774
- * The offline threading id associated with this message
984
+ * Whether to include periodic keepalive ping messages in the stream to prevent
985
+ * connection timeouts (only used when streaming=true).
775
986
  */
776
- otid?: string | null;
987
+ include_pings?: boolean;
777
988
 
778
989
  /**
779
- * The id of the run that this message was created in.
990
+ * Only return specified message types in the response. If `None` (default) returns
991
+ * all messages.
780
992
  */
781
- run_id?: string | null;
993
+ include_return_message_types?: Array<MessageType> | null;
782
994
 
783
995
  /**
784
- * The id of the sender of the message, can be an identity id or agent id
996
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
997
+ * 'user', 'content': input}].
785
998
  */
786
- sender_id?: string | null;
999
+ input?:
1000
+ | string
1001
+ | Array<
1002
+ | TextContent
1003
+ | ImageContent
1004
+ | ToolCallContent
1005
+ | ToolReturnContent
1006
+ | ReasoningContent
1007
+ | RedactedReasoningContent
1008
+ | OmittedReasoningContent
1009
+ | LettaStreamingRequest.SummarizedReasoningContent
1010
+ >
1011
+ | null;
787
1012
 
788
1013
  /**
789
- * The id of the step that this message was created in.
1014
+ * Maximum number of steps the agent should take to process the request.
790
1015
  */
791
- step_id?: string | null;
1016
+ max_steps?: number;
792
1017
 
793
1018
  /**
794
- * The ID of the tool call. Only applicable for role tool.
1019
+ * The messages to be sent to the agent.
795
1020
  */
796
- tool_call_id?: string | null;
1021
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
797
1022
 
798
1023
  /**
799
- * The list of tool calls requested. Only applicable for role assistant.
1024
+ * Flag to determine if individual tokens should be streamed, rather than streaming
1025
+ * per step (only used when streaming=true).
800
1026
  */
801
- tool_calls?: Array<Message.ToolCall> | null;
1027
+ stream_tokens?: boolean;
802
1028
 
803
1029
  /**
804
- * Tool execution return information for prior tool calls
1030
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1031
+ * returns a complete response.
805
1032
  */
806
- tool_returns?: Array<Message.ToolReturn> | null;
1033
+ streaming?: boolean;
807
1034
 
808
1035
  /**
809
- * The timestamp when the object was last updated.
1036
+ * @deprecated Whether the server should parse specific tool call arguments
1037
+ * (default `send_message`) as `AssistantMessage` objects. Still supported for
1038
+ * legacy agent types, but deprecated for letta_v1_agent onward.
810
1039
  */
811
- updated_at?: string | null;
1040
+ use_assistant_message?: boolean;
812
1041
  }
813
1042
 
814
- export namespace Message {
815
- export interface ApprovalReturn {
816
- /**
817
- * Whether the tool has been approved
818
- */
819
- approve: boolean;
820
-
821
- /**
822
- * The ID of the tool call that corresponds to this approval
823
- */
824
- tool_call_id: string;
825
-
826
- /**
827
- * An optional explanation for the provided approval status
828
- */
829
- reason?: string | null;
830
-
831
- /**
832
- * The message type to be created.
833
- */
834
- type?: 'approval';
835
- }
836
-
837
- export interface LettaSchemasMessageToolReturn {
838
- /**
839
- * The status of the tool call
840
- */
841
- status: 'success' | 'error';
842
-
843
- /**
844
- * The function response string
845
- */
846
- func_response?: string | null;
847
-
848
- /**
849
- * Captured stderr from the tool invocation
850
- */
851
- stderr?: Array<string> | null;
852
-
853
- /**
854
- * Captured stdout (e.g. prints, logs) from the tool invocation
855
- */
856
- stdout?: Array<string> | null;
857
-
858
- /**
859
- * The ID for the tool call
860
- */
861
- tool_call_id?: unknown;
862
- }
863
-
1043
+ export namespace LettaStreamingRequest {
864
1044
  /**
865
1045
  * The style of reasoning content returned by the OpenAI Responses API
866
1046
  */
@@ -899,55 +1079,114 @@ export namespace Message {
899
1079
  text: string;
900
1080
  }
901
1081
  }
1082
+ }
902
1083
 
903
- export interface ToolCall {
904
- id: string;
905
-
906
- function: ToolCall.Function;
907
-
908
- type: 'function';
1084
+ /**
1085
+ * Streaming response type for Server-Sent Events (SSE) endpoints. Each event in
1086
+ * the stream will be one of these types.
1087
+ */
1088
+ export type LettaStreamingResponse =
1089
+ | SystemMessage
1090
+ | UserMessage
1091
+ | ReasoningMessage
1092
+ | HiddenReasoningMessage
1093
+ | ToolCallMessage
1094
+ | ToolsAPI.ToolReturnMessage
1095
+ | AssistantMessage
1096
+ | ApprovalRequestMessage
1097
+ | ApprovalResponseMessage
1098
+ | LettaStreamingResponse.LettaPing
1099
+ | LettaStreamingResponse.LettaStopReason
1100
+ | LettaStreamingResponse.LettaUsageStatistics;
909
1101
 
910
- [k: string]: unknown;
1102
+ export namespace LettaStreamingResponse {
1103
+ /**
1104
+ * Ping messages are a keep-alive to prevent SSE streams from timing out during
1105
+ * long running requests.
1106
+ */
1107
+ export interface LettaPing {
1108
+ /**
1109
+ * The type of the message.
1110
+ */
1111
+ message_type: 'ping';
911
1112
  }
912
1113
 
913
- export namespace ToolCall {
914
- export interface Function {
915
- arguments: string;
916
-
917
- name: string;
1114
+ /**
1115
+ * The stop reason from Letta indicating why agent loop stopped execution.
1116
+ */
1117
+ export interface LettaStopReason {
1118
+ /**
1119
+ * The reason why execution stopped.
1120
+ */
1121
+ stop_reason: RunsAPI.StopReasonType;
918
1122
 
919
- [k: string]: unknown;
920
- }
1123
+ /**
1124
+ * The type of the message.
1125
+ */
1126
+ message_type?: 'stop_reason';
921
1127
  }
922
1128
 
923
- export interface ToolReturn {
1129
+ /**
1130
+ * Usage statistics for the agent interaction.
1131
+ *
1132
+ * Attributes: completion_tokens (int): The number of tokens generated by the
1133
+ * agent. prompt_tokens (int): The number of tokens in the prompt. total_tokens
1134
+ * (int): The total number of tokens processed by the agent. step_count (int): The
1135
+ * number of steps taken by the agent.
1136
+ */
1137
+ export interface LettaUsageStatistics {
924
1138
  /**
925
- * The status of the tool call
1139
+ * The number of tokens generated by the agent.
926
1140
  */
927
- status: 'success' | 'error';
1141
+ completion_tokens?: number;
1142
+
1143
+ message_type?: 'usage_statistics';
928
1144
 
929
1145
  /**
930
- * The function response string
1146
+ * The number of tokens in the prompt.
931
1147
  */
932
- func_response?: string | null;
1148
+ prompt_tokens?: number;
933
1149
 
934
1150
  /**
935
- * Captured stderr from the tool invocation
1151
+ * The background task run IDs associated with the agent interaction
936
1152
  */
937
- stderr?: Array<string> | null;
1153
+ run_ids?: Array<string> | null;
938
1154
 
939
1155
  /**
940
- * Captured stdout (e.g. prints, logs) from the tool invocation
1156
+ * The number of steps taken by the agent.
941
1157
  */
942
- stdout?: Array<string> | null;
1158
+ step_count?: number;
943
1159
 
944
1160
  /**
945
- * The ID for the tool call
1161
+ * The total number of tokens processed by the agent.
946
1162
  */
947
- tool_call_id?: unknown;
1163
+ total_tokens?: number;
948
1164
  }
949
1165
  }
950
1166
 
1167
+ export type LettaUserMessageContentUnion = TextContent | ImageContent;
1168
+
1169
+ /**
1170
+ * A message generated by the system. Never streamed back on a response, only used
1171
+ * for cursor pagination.
1172
+ *
1173
+ * Args: id (str): The ID of the message date (datetime): The date the message was
1174
+ * created in ISO format name (Optional[str]): The name of the sender of the
1175
+ * message content (str): The message content sent by the system
1176
+ */
1177
+ export type Message =
1178
+ | SystemMessage
1179
+ | UserMessage
1180
+ | ReasoningMessage
1181
+ | HiddenReasoningMessage
1182
+ | ToolCallMessage
1183
+ | ToolsAPI.ToolReturnMessage
1184
+ | AssistantMessage
1185
+ | ApprovalRequestMessage
1186
+ | ApprovalResponseMessage
1187
+ | SummaryMessage
1188
+ | EventMessage;
1189
+
951
1190
  export type MessageRole = 'assistant' | 'user' | 'tool' | 'function' | 'system' | 'approval';
952
1191
 
953
1192
  export type MessageType =
@@ -1063,27 +1302,17 @@ export interface RedactedReasoningContent {
1063
1302
  * Representation of a run - a conversation or processing session for an agent.
1064
1303
  * Runs track when agents process messages and maintain the relationship between
1065
1304
  * agents, steps, and messages.
1066
- *
1067
- * Parameters: id (str): The unique identifier of the run (prefixed with 'run-').
1068
- * status (JobStatus): The current status of the run. created_at (datetime): The
1069
- * timestamp when the run was created. completed_at (datetime): The timestamp when
1070
- * the run was completed. agent_id (str): The unique identifier of the agent
1071
- * associated with the run. base_template_id (str): The base template ID that the
1072
- * run belongs to. stop_reason (StopReasonType): The reason why the run was
1073
- * stopped. background (bool): Whether the run was created in background mode.
1074
- * metadata (dict): Additional metadata for the run. request_config
1075
- * (LettaRequestConfig): The request configuration for the run.
1076
1305
  */
1077
1306
  export interface Run {
1078
1307
  /**
1079
- * The unique identifier of the agent associated with the run.
1308
+ * The human-friendly ID of the Run
1080
1309
  */
1081
- agent_id: string;
1310
+ id: string;
1082
1311
 
1083
1312
  /**
1084
- * The human-friendly ID of the Run
1313
+ * The unique identifier of the agent associated with the run.
1085
1314
  */
1086
- id?: string;
1315
+ agent_id: string;
1087
1316
 
1088
1317
  /**
1089
1318
  * Whether the run was created in background mode.
@@ -1185,6 +1414,34 @@ export namespace Run {
1185
1414
  }
1186
1415
  }
1187
1416
 
1417
+ /**
1418
+ * A message representing a summary of the conversation. Sent to the LLM as a user
1419
+ * or system message depending on the provider.
1420
+ */
1421
+ export interface SummaryMessage {
1422
+ id: string;
1423
+
1424
+ date: string;
1425
+
1426
+ summary: string;
1427
+
1428
+ is_err?: boolean | null;
1429
+
1430
+ message_type?: 'summary';
1431
+
1432
+ name?: string | null;
1433
+
1434
+ otid?: string | null;
1435
+
1436
+ run_id?: string | null;
1437
+
1438
+ sender_id?: string | null;
1439
+
1440
+ seq_id?: number | null;
1441
+
1442
+ step_id?: string | null;
1443
+ }
1444
+
1188
1445
  /**
1189
1446
  * A message generated by the system. Never streamed back on a response, only used
1190
1447
  * for cursor pagination.
@@ -1422,248 +1679,210 @@ export interface UserMessage {
1422
1679
 
1423
1680
  is_err?: boolean | null;
1424
1681
 
1425
- /**
1426
- * The type of the message.
1427
- */
1428
- message_type?: 'user_message';
1429
-
1430
- name?: string | null;
1431
-
1432
- otid?: string | null;
1433
-
1434
- run_id?: string | null;
1435
-
1436
- sender_id?: string | null;
1437
-
1438
- seq_id?: number | null;
1439
-
1440
- step_id?: string | null;
1441
- }
1442
-
1443
- /**
1444
- * A message generated by the system. Never streamed back on a response, only used
1445
- * for cursor pagination.
1446
- *
1447
- * Args: id (str): The ID of the message date (datetime): The date the message was
1448
- * created in ISO format name (Optional[str]): The name of the sender of the
1449
- * message content (str): The message content sent by the system
1450
- */
1451
- export type MessageUpdateResponse =
1452
- | SystemMessage
1453
- | UserMessage
1454
- | ReasoningMessage
1455
- | HiddenReasoningMessage
1456
- | ToolCallMessage
1457
- | ToolsAPI.ToolReturnMessage
1458
- | AssistantMessage
1459
- | ApprovalRequestMessage
1460
- | ApprovalResponseMessage;
1461
-
1462
- export type MessageListResponse = Array<LettaMessageUnion>;
1463
-
1464
- export type MessageCancelResponse = { [key: string]: unknown };
1465
-
1466
- export type MessageStreamResponse = unknown;
1467
-
1468
- export type MessageUpdateParams =
1469
- | MessageUpdateParams.UpdateSystemMessage
1470
- | MessageUpdateParams.UpdateUserMessage
1471
- | MessageUpdateParams.UpdateReasoningMessage
1472
- | MessageUpdateParams.UpdateAssistantMessage;
1473
-
1474
- export declare namespace MessageUpdateParams {
1475
- export interface UpdateSystemMessage {
1476
- /**
1477
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1478
- */
1479
- agent_id: string;
1480
-
1481
- /**
1482
- * Body param: The message content sent by the system (can be a string or an array
1483
- * of multi-modal content parts)
1484
- */
1485
- content: string;
1682
+ /**
1683
+ * The type of the message.
1684
+ */
1685
+ message_type?: 'user_message';
1486
1686
 
1487
- /**
1488
- * Body param:
1489
- */
1490
- message_type?: 'system_message';
1491
- }
1687
+ name?: string | null;
1492
1688
 
1493
- export interface UpdateUserMessage {
1494
- /**
1495
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1496
- */
1497
- agent_id: string;
1689
+ otid?: string | null;
1498
1690
 
1499
- /**
1500
- * Body param: The message content sent by the user (can be a string or an array of
1501
- * multi-modal content parts)
1502
- */
1503
- content: Array<LettaUserMessageContentUnion> | string;
1691
+ run_id?: string | null;
1504
1692
 
1505
- /**
1506
- * Body param:
1507
- */
1508
- message_type?: 'user_message';
1509
- }
1693
+ sender_id?: string | null;
1510
1694
 
1511
- export interface UpdateReasoningMessage {
1512
- /**
1513
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1514
- */
1515
- agent_id: string;
1695
+ seq_id?: number | null;
1516
1696
 
1517
- /**
1518
- * Body param:
1519
- */
1520
- reasoning: string;
1697
+ step_id?: string | null;
1698
+ }
1521
1699
 
1522
- /**
1523
- * Body param:
1524
- */
1525
- message_type?: 'reasoning_message';
1526
- }
1700
+ export type MessageCancelResponse = { [key: string]: unknown };
1527
1701
 
1528
- export interface UpdateAssistantMessage {
1529
- /**
1530
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1531
- */
1532
- agent_id: string;
1702
+ export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
1533
1703
 
1534
- /**
1535
- * Body param: The message content sent by the assistant (can be a string or an
1536
- * array of content parts)
1537
- */
1538
- content: Array<LettaAssistantMessageContentUnion> | string;
1704
+ export interface MessageCreateParamsBase {
1705
+ /**
1706
+ * @deprecated The name of the message argument in the designated message tool.
1707
+ * Still supported for legacy agent types, but deprecated for letta_v1_agent
1708
+ * onward.
1709
+ */
1710
+ assistant_message_tool_kwarg?: string;
1539
1711
 
1540
- /**
1541
- * Body param:
1542
- */
1543
- message_type?: 'assistant_message';
1544
- }
1545
- }
1712
+ /**
1713
+ * @deprecated The name of the designated message tool. Still supported for legacy
1714
+ * agent types, but deprecated for letta_v1_agent onward.
1715
+ */
1716
+ assistant_message_tool_name?: string;
1546
1717
 
1547
- export interface MessageListParams {
1548
1718
  /**
1549
- * Message ID cursor for pagination. Returns messages that come after this message
1550
- * ID in the specified sort order
1719
+ * Whether to process the request in the background (only used when
1720
+ * streaming=true).
1551
1721
  */
1552
- after?: string | null;
1722
+ background?: boolean;
1553
1723
 
1554
1724
  /**
1555
- * @deprecated The name of the message argument.
1725
+ * @deprecated If set to True, enables reasoning before responses or tool calls
1726
+ * from the agent.
1556
1727
  */
1557
- assistant_message_tool_kwarg?: string;
1728
+ enable_thinking?: string;
1558
1729
 
1559
1730
  /**
1560
- * @deprecated The name of the designated message tool.
1731
+ * Whether to include periodic keepalive ping messages in the stream to prevent
1732
+ * connection timeouts (only used when streaming=true).
1561
1733
  */
1562
- assistant_message_tool_name?: string;
1734
+ include_pings?: boolean;
1563
1735
 
1564
1736
  /**
1565
- * Message ID cursor for pagination. Returns messages that come before this message
1566
- * ID in the specified sort order
1737
+ * Only return specified message types in the response. If `None` (default) returns
1738
+ * all messages.
1567
1739
  */
1568
- before?: string | null;
1740
+ include_return_message_types?: Array<MessageType> | null;
1569
1741
 
1570
1742
  /**
1571
- * Group ID to filter messages by.
1743
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1744
+ * 'user', 'content': input}].
1572
1745
  */
1573
- group_id?: string | null;
1746
+ input?:
1747
+ | string
1748
+ | Array<
1749
+ | TextContent
1750
+ | ImageContent
1751
+ | ToolCallContent
1752
+ | ToolReturnContent
1753
+ | ReasoningContent
1754
+ | RedactedReasoningContent
1755
+ | OmittedReasoningContent
1756
+ | MessageCreateParams.SummarizedReasoningContent
1757
+ >
1758
+ | null;
1574
1759
 
1575
1760
  /**
1576
- * Whether to include error messages and error statuses. For debugging purposes
1577
- * only.
1761
+ * Maximum number of steps the agent should take to process the request.
1578
1762
  */
1579
- include_err?: boolean | null;
1763
+ max_steps?: number;
1580
1764
 
1581
1765
  /**
1582
- * Maximum number of messages to return
1766
+ * The messages to be sent to the agent.
1583
1767
  */
1584
- limit?: number | null;
1768
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1585
1769
 
1586
1770
  /**
1587
- * Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
1588
- * newest first
1771
+ * Flag to determine if individual tokens should be streamed, rather than streaming
1772
+ * per step (only used when streaming=true).
1589
1773
  */
1590
- order?: 'asc' | 'desc';
1774
+ stream_tokens?: boolean;
1591
1775
 
1592
1776
  /**
1593
- * Field to sort by
1777
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1778
+ * returns a complete response.
1594
1779
  */
1595
- order_by?: 'created_at';
1780
+ streaming?: boolean;
1596
1781
 
1597
1782
  /**
1598
- * @deprecated Whether to use assistant messages
1783
+ * @deprecated Whether the server should parse specific tool call arguments
1784
+ * (default `send_message`) as `AssistantMessage` objects. Still supported for
1785
+ * legacy agent types, but deprecated for letta_v1_agent onward.
1599
1786
  */
1600
1787
  use_assistant_message?: boolean;
1601
1788
  }
1602
1789
 
1603
- export interface MessageCancelParams {
1790
+ export namespace MessageCreateParams {
1604
1791
  /**
1605
- * Optional list of run IDs to cancel
1792
+ * The style of reasoning content returned by the OpenAI Responses API
1606
1793
  */
1607
- run_ids?: Array<string> | null;
1794
+ export interface SummarizedReasoningContent {
1795
+ /**
1796
+ * The unique identifier for this reasoning step.
1797
+ */
1798
+ id: string;
1799
+
1800
+ /**
1801
+ * Summaries of the reasoning content.
1802
+ */
1803
+ summary: Array<SummarizedReasoningContent.Summary>;
1804
+
1805
+ /**
1806
+ * The encrypted reasoning content.
1807
+ */
1808
+ encrypted_content?: string;
1809
+
1810
+ /**
1811
+ * Indicates this is a summarized reasoning step.
1812
+ */
1813
+ type?: 'summarized_reasoning';
1814
+ }
1815
+
1816
+ export namespace SummarizedReasoningContent {
1817
+ export interface Summary {
1818
+ /**
1819
+ * The index of the summary part.
1820
+ */
1821
+ index: number;
1822
+
1823
+ /**
1824
+ * The text of the summary part.
1825
+ */
1826
+ text: string;
1827
+ }
1828
+ }
1829
+
1830
+ export type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
1831
+ export type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
1608
1832
  }
1609
1833
 
1610
- export interface MessageResetParams {
1834
+ export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
1611
1835
  /**
1612
- * If true, adds the default initial messages after resetting.
1836
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1837
+ * returns a complete response.
1613
1838
  */
1614
- add_default_initial_messages?: boolean;
1839
+ streaming?: false;
1615
1840
  }
1616
1841
 
1617
- export interface MessageSendParams {
1842
+ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
1618
1843
  /**
1619
- * The messages to be sent to the agent.
1844
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1845
+ * returns a complete response.
1620
1846
  */
1621
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1847
+ streaming: true;
1848
+ }
1622
1849
 
1850
+ export interface MessageListParams extends ArrayPageParams {
1623
1851
  /**
1624
- * @deprecated The name of the message argument in the designated message tool.
1625
- * Still supported for legacy agent types, but deprecated for letta_v1_agent
1626
- * onward.
1852
+ * @deprecated The name of the message argument.
1627
1853
  */
1628
1854
  assistant_message_tool_kwarg?: string;
1629
1855
 
1630
1856
  /**
1631
- * @deprecated The name of the designated message tool. Still supported for legacy
1632
- * agent types, but deprecated for letta_v1_agent onward.
1857
+ * @deprecated The name of the designated message tool.
1633
1858
  */
1634
1859
  assistant_message_tool_name?: string;
1635
1860
 
1636
1861
  /**
1637
- * @deprecated If set to True, enables reasoning before responses or tool calls
1638
- * from the agent.
1639
- */
1640
- enable_thinking?: string;
1641
-
1642
- /**
1643
- * Only return specified message types in the response. If `None` (default) returns
1644
- * all messages.
1862
+ * Group ID to filter messages by.
1645
1863
  */
1646
- include_return_message_types?: Array<MessageType> | null;
1864
+ group_id?: string | null;
1647
1865
 
1648
1866
  /**
1649
- * Maximum number of steps the agent should take to process the request.
1867
+ * Whether to include error messages and error statuses. For debugging purposes
1868
+ * only.
1650
1869
  */
1651
- max_steps?: number;
1870
+ include_err?: boolean | null;
1652
1871
 
1653
1872
  /**
1654
- * @deprecated Whether the server should parse specific tool call arguments
1655
- * (default `send_message`) as `AssistantMessage` objects. Still supported for
1656
- * legacy agent types, but deprecated for letta_v1_agent onward.
1873
+ * @deprecated Whether to use assistant messages
1657
1874
  */
1658
1875
  use_assistant_message?: boolean;
1659
1876
  }
1660
1877
 
1661
- export interface MessageSendAsyncParams {
1878
+ export interface MessageCancelParams {
1662
1879
  /**
1663
- * The messages to be sent to the agent.
1880
+ * Optional list of run IDs to cancel
1664
1881
  */
1665
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1882
+ run_ids?: Array<string> | null;
1883
+ }
1666
1884
 
1885
+ export interface MessageCreateAsyncParams {
1667
1886
  /**
1668
1887
  * @deprecated The name of the message argument in the designated message tool.
1669
1888
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1694,11 +1913,34 @@ export interface MessageSendAsyncParams {
1694
1913
  */
1695
1914
  include_return_message_types?: Array<MessageType> | null;
1696
1915
 
1916
+ /**
1917
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1918
+ * 'user', 'content': input}].
1919
+ */
1920
+ input?:
1921
+ | string
1922
+ | Array<
1923
+ | TextContent
1924
+ | ImageContent
1925
+ | ToolCallContent
1926
+ | ToolReturnContent
1927
+ | ReasoningContent
1928
+ | RedactedReasoningContent
1929
+ | OmittedReasoningContent
1930
+ | MessageCreateAsyncParams.SummarizedReasoningContent
1931
+ >
1932
+ | null;
1933
+
1697
1934
  /**
1698
1935
  * Maximum number of steps the agent should take to process the request.
1699
1936
  */
1700
1937
  max_steps?: number;
1701
1938
 
1939
+ /**
1940
+ * The messages to be sent to the agent.
1941
+ */
1942
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1943
+
1702
1944
  /**
1703
1945
  * @deprecated Whether the server should parse specific tool call arguments
1704
1946
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1707,12 +1949,55 @@ export interface MessageSendAsyncParams {
1707
1949
  use_assistant_message?: boolean;
1708
1950
  }
1709
1951
 
1710
- export interface MessageStreamParams {
1952
+ export namespace MessageCreateAsyncParams {
1711
1953
  /**
1712
- * The messages to be sent to the agent.
1954
+ * The style of reasoning content returned by the OpenAI Responses API
1955
+ */
1956
+ export interface SummarizedReasoningContent {
1957
+ /**
1958
+ * The unique identifier for this reasoning step.
1959
+ */
1960
+ id: string;
1961
+
1962
+ /**
1963
+ * Summaries of the reasoning content.
1964
+ */
1965
+ summary: Array<SummarizedReasoningContent.Summary>;
1966
+
1967
+ /**
1968
+ * The encrypted reasoning content.
1969
+ */
1970
+ encrypted_content?: string;
1971
+
1972
+ /**
1973
+ * Indicates this is a summarized reasoning step.
1974
+ */
1975
+ type?: 'summarized_reasoning';
1976
+ }
1977
+
1978
+ export namespace SummarizedReasoningContent {
1979
+ export interface Summary {
1980
+ /**
1981
+ * The index of the summary part.
1982
+ */
1983
+ index: number;
1984
+
1985
+ /**
1986
+ * The text of the summary part.
1987
+ */
1988
+ text: string;
1989
+ }
1990
+ }
1991
+ }
1992
+
1993
+ export interface MessageResetParams {
1994
+ /**
1995
+ * If true, adds the default initial messages after resetting.
1713
1996
  */
1714
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1997
+ add_default_initial_messages?: boolean;
1998
+ }
1715
1999
 
2000
+ export interface MessageStreamParams {
1716
2001
  /**
1717
2002
  * @deprecated The name of the message argument in the designated message tool.
1718
2003
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1727,7 +2012,8 @@ export interface MessageStreamParams {
1727
2012
  assistant_message_tool_name?: string;
1728
2013
 
1729
2014
  /**
1730
- * Whether to process the request in the background.
2015
+ * Whether to process the request in the background (only used when
2016
+ * streaming=true).
1731
2017
  */
1732
2018
  background?: boolean;
1733
2019
 
@@ -1739,7 +2025,7 @@ export interface MessageStreamParams {
1739
2025
 
1740
2026
  /**
1741
2027
  * Whether to include periodic keepalive ping messages in the stream to prevent
1742
- * connection timeouts.
2028
+ * connection timeouts (only used when streaming=true).
1743
2029
  */
1744
2030
  include_pings?: boolean;
1745
2031
 
@@ -1749,17 +2035,46 @@ export interface MessageStreamParams {
1749
2035
  */
1750
2036
  include_return_message_types?: Array<MessageType> | null;
1751
2037
 
2038
+ /**
2039
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
2040
+ * 'user', 'content': input}].
2041
+ */
2042
+ input?:
2043
+ | string
2044
+ | Array<
2045
+ | TextContent
2046
+ | ImageContent
2047
+ | ToolCallContent
2048
+ | ToolReturnContent
2049
+ | ReasoningContent
2050
+ | RedactedReasoningContent
2051
+ | OmittedReasoningContent
2052
+ | MessageStreamParams.SummarizedReasoningContent
2053
+ >
2054
+ | null;
2055
+
1752
2056
  /**
1753
2057
  * Maximum number of steps the agent should take to process the request.
1754
2058
  */
1755
2059
  max_steps?: number;
1756
2060
 
2061
+ /**
2062
+ * The messages to be sent to the agent.
2063
+ */
2064
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
2065
+
1757
2066
  /**
1758
2067
  * Flag to determine if individual tokens should be streamed, rather than streaming
1759
- * per step.
2068
+ * per step (only used when streaming=true).
1760
2069
  */
1761
2070
  stream_tokens?: boolean;
1762
2071
 
2072
+ /**
2073
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
2074
+ * returns a complete response.
2075
+ */
2076
+ streaming?: boolean;
2077
+
1763
2078
  /**
1764
2079
  * @deprecated Whether the server should parse specific tool call arguments
1765
2080
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1768,21 +2083,65 @@ export interface MessageStreamParams {
1768
2083
  use_assistant_message?: boolean;
1769
2084
  }
1770
2085
 
2086
+ export namespace MessageStreamParams {
2087
+ /**
2088
+ * The style of reasoning content returned by the OpenAI Responses API
2089
+ */
2090
+ export interface SummarizedReasoningContent {
2091
+ /**
2092
+ * The unique identifier for this reasoning step.
2093
+ */
2094
+ id: string;
2095
+
2096
+ /**
2097
+ * Summaries of the reasoning content.
2098
+ */
2099
+ summary: Array<SummarizedReasoningContent.Summary>;
2100
+
2101
+ /**
2102
+ * The encrypted reasoning content.
2103
+ */
2104
+ encrypted_content?: string;
2105
+
2106
+ /**
2107
+ * Indicates this is a summarized reasoning step.
2108
+ */
2109
+ type?: 'summarized_reasoning';
2110
+ }
2111
+
2112
+ export namespace SummarizedReasoningContent {
2113
+ export interface Summary {
2114
+ /**
2115
+ * The index of the summary part.
2116
+ */
2117
+ index: number;
2118
+
2119
+ /**
2120
+ * The text of the summary part.
2121
+ */
2122
+ text: string;
2123
+ }
2124
+ }
2125
+ }
2126
+
1771
2127
  export declare namespace Messages {
1772
2128
  export {
1773
2129
  type ApprovalCreate as ApprovalCreate,
1774
2130
  type ApprovalRequestMessage as ApprovalRequestMessage,
1775
2131
  type ApprovalResponseMessage as ApprovalResponseMessage,
2132
+ type ApprovalReturn as ApprovalReturn,
1776
2133
  type AssistantMessage as AssistantMessage,
2134
+ type EventMessage as EventMessage,
1777
2135
  type HiddenReasoningMessage as HiddenReasoningMessage,
1778
2136
  type ImageContent as ImageContent,
2137
+ type InternalMessage as InternalMessage,
1779
2138
  type JobStatus as JobStatus,
1780
2139
  type JobType as JobType,
1781
2140
  type LettaAssistantMessageContentUnion as LettaAssistantMessageContentUnion,
1782
- type LettaMessageUnion as LettaMessageUnion,
1783
2141
  type LettaRequest as LettaRequest,
1784
2142
  type LettaResponse as LettaResponse,
1785
2143
  type LettaStreamingRequest as LettaStreamingRequest,
2144
+ type LettaStreamingResponse as LettaStreamingResponse,
1786
2145
  type LettaUserMessageContentUnion as LettaUserMessageContentUnion,
1787
2146
  type Message as Message,
1788
2147
  type MessageRole as MessageRole,
@@ -1792,6 +2151,7 @@ export declare namespace Messages {
1792
2151
  type ReasoningMessage as ReasoningMessage,
1793
2152
  type RedactedReasoningContent as RedactedReasoningContent,
1794
2153
  type Run as Run,
2154
+ type SummaryMessage as SummaryMessage,
1795
2155
  type SystemMessage as SystemMessage,
1796
2156
  type TextContent as TextContent,
1797
2157
  type ToolCall as ToolCall,
@@ -1805,16 +2165,15 @@ export declare namespace Messages {
1805
2165
  type UpdateSystemMessage as UpdateSystemMessage,
1806
2166
  type UpdateUserMessage as UpdateUserMessage,
1807
2167
  type UserMessage as UserMessage,
1808
- type MessageUpdateResponse as MessageUpdateResponse,
1809
- type MessageListResponse as MessageListResponse,
1810
2168
  type MessageCancelResponse as MessageCancelResponse,
1811
- type MessageStreamResponse as MessageStreamResponse,
1812
- type MessageUpdateParams as MessageUpdateParams,
2169
+ type MessagesArrayPage as MessagesArrayPage,
2170
+ type MessageCreateParams as MessageCreateParams,
2171
+ type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
2172
+ type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
1813
2173
  type MessageListParams as MessageListParams,
1814
2174
  type MessageCancelParams as MessageCancelParams,
2175
+ type MessageCreateAsyncParams as MessageCreateAsyncParams,
1815
2176
  type MessageResetParams as MessageResetParams,
1816
- type MessageSendParams as MessageSendParams,
1817
- type MessageSendAsyncParams as MessageSendAsyncParams,
1818
2177
  type MessageStreamParams as MessageStreamParams,
1819
2178
  };
1820
2179
  }