@letta-ai/letta-client 1.0.0-alpha.7 → 1.1.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 (512) hide show
  1. package/CHANGELOG.md +248 -0
  2. package/README.md +282 -319
  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 +668 -422
  138. package/resources/agents/messages.d.mts.map +1 -1
  139. package/resources/agents/messages.d.ts +668 -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/identities/properties.d.mts +1 -1
  304. package/resources/identities/properties.d.ts +1 -1
  305. package/resources/identities/properties.js +1 -1
  306. package/resources/identities/properties.mjs +1 -1
  307. package/resources/index.d.mts +13 -11
  308. package/resources/index.d.mts.map +1 -1
  309. package/resources/index.d.ts +13 -11
  310. package/resources/index.d.ts.map +1 -1
  311. package/resources/index.js +6 -2
  312. package/resources/index.js.map +1 -1
  313. package/resources/index.mjs +3 -1
  314. package/resources/index.mjs.map +1 -1
  315. package/resources/mcp-servers/index.d.mts +3 -0
  316. package/resources/mcp-servers/index.d.mts.map +1 -0
  317. package/resources/mcp-servers/index.d.ts +3 -0
  318. package/resources/mcp-servers/index.d.ts.map +1 -0
  319. package/resources/mcp-servers/index.js +9 -0
  320. package/resources/mcp-servers/index.js.map +1 -0
  321. package/resources/mcp-servers/index.mjs +4 -0
  322. package/resources/mcp-servers/index.mjs.map +1 -0
  323. package/resources/mcp-servers/mcp-servers.d.mts +349 -0
  324. package/resources/mcp-servers/mcp-servers.d.mts.map +1 -0
  325. package/resources/mcp-servers/mcp-servers.d.ts +349 -0
  326. package/resources/mcp-servers/mcp-servers.d.ts.map +1 -0
  327. package/resources/mcp-servers/mcp-servers.js +69 -0
  328. package/resources/mcp-servers/mcp-servers.js.map +1 -0
  329. package/resources/mcp-servers/mcp-servers.mjs +64 -0
  330. package/resources/mcp-servers/mcp-servers.mjs.map +1 -0
  331. package/resources/mcp-servers/tools.d.mts +42 -0
  332. package/resources/mcp-servers/tools.d.mts.map +1 -0
  333. package/resources/mcp-servers/tools.d.ts +42 -0
  334. package/resources/mcp-servers/tools.d.ts.map +1 -0
  335. package/resources/mcp-servers/tools.js +36 -0
  336. package/resources/mcp-servers/tools.js.map +1 -0
  337. package/resources/mcp-servers/tools.mjs +32 -0
  338. package/resources/mcp-servers/tools.mjs.map +1 -0
  339. package/resources/mcp-servers.d.mts +2 -0
  340. package/resources/mcp-servers.d.mts.map +1 -0
  341. package/resources/mcp-servers.d.ts +2 -0
  342. package/resources/mcp-servers.d.ts.map +1 -0
  343. package/resources/mcp-servers.js +6 -0
  344. package/resources/mcp-servers.js.map +1 -0
  345. package/resources/mcp-servers.mjs +3 -0
  346. package/resources/mcp-servers.mjs.map +1 -0
  347. package/resources/models/embeddings.d.mts +6 -2
  348. package/resources/models/embeddings.d.mts.map +1 -1
  349. package/resources/models/embeddings.d.ts +6 -2
  350. package/resources/models/embeddings.d.ts.map +1 -1
  351. package/resources/models/embeddings.js +5 -1
  352. package/resources/models/embeddings.js.map +1 -1
  353. package/resources/models/embeddings.mjs +5 -1
  354. package/resources/models/embeddings.mjs.map +1 -1
  355. package/resources/models/index.d.mts +1 -1
  356. package/resources/models/index.d.mts.map +1 -1
  357. package/resources/models/index.d.ts +1 -1
  358. package/resources/models/index.d.ts.map +1 -1
  359. package/resources/models/index.js.map +1 -1
  360. package/resources/models/index.mjs.map +1 -1
  361. package/resources/models/models.d.mts +180 -4
  362. package/resources/models/models.d.mts.map +1 -1
  363. package/resources/models/models.d.ts +180 -4
  364. package/resources/models/models.d.ts.map +1 -1
  365. package/resources/models/models.js +5 -1
  366. package/resources/models/models.js.map +1 -1
  367. package/resources/models/models.mjs +5 -1
  368. package/resources/models/models.mjs.map +1 -1
  369. package/resources/runs/index.d.mts +3 -3
  370. package/resources/runs/index.d.mts.map +1 -1
  371. package/resources/runs/index.d.ts +3 -3
  372. package/resources/runs/index.d.ts.map +1 -1
  373. package/resources/runs/index.js.map +1 -1
  374. package/resources/runs/index.mjs.map +1 -1
  375. package/resources/runs/messages.d.mts +8 -28
  376. package/resources/runs/messages.d.mts.map +1 -1
  377. package/resources/runs/messages.d.ts +8 -28
  378. package/resources/runs/messages.d.ts.map +1 -1
  379. package/resources/runs/messages.js +10 -2
  380. package/resources/runs/messages.js.map +1 -1
  381. package/resources/runs/messages.mjs +10 -2
  382. package/resources/runs/messages.mjs.map +1 -1
  383. package/resources/runs/runs.d.mts +10 -36
  384. package/resources/runs/runs.d.mts.map +1 -1
  385. package/resources/runs/runs.d.ts +10 -36
  386. package/resources/runs/runs.d.ts.map +1 -1
  387. package/resources/runs/runs.js +2 -1
  388. package/resources/runs/runs.js.map +1 -1
  389. package/resources/runs/runs.mjs +3 -2
  390. package/resources/runs/runs.mjs.map +1 -1
  391. package/resources/runs/steps.d.mts +6 -26
  392. package/resources/runs/steps.d.mts.map +1 -1
  393. package/resources/runs/steps.d.ts +6 -26
  394. package/resources/runs/steps.d.ts.map +1 -1
  395. package/resources/runs/steps.js +5 -1
  396. package/resources/runs/steps.js.map +1 -1
  397. package/resources/runs/steps.mjs +5 -1
  398. package/resources/runs/steps.mjs.map +1 -1
  399. package/resources/steps/index.d.mts +2 -2
  400. package/resources/steps/index.d.mts.map +1 -1
  401. package/resources/steps/index.d.ts +2 -2
  402. package/resources/steps/index.d.ts.map +1 -1
  403. package/resources/steps/index.js.map +1 -1
  404. package/resources/steps/index.mjs +1 -1
  405. package/resources/steps/index.mjs.map +1 -1
  406. package/resources/steps/messages.d.mts +14 -28
  407. package/resources/steps/messages.d.mts.map +1 -1
  408. package/resources/steps/messages.d.ts +14 -28
  409. package/resources/steps/messages.d.ts.map +1 -1
  410. package/resources/steps/messages.js +5 -1
  411. package/resources/steps/messages.js.map +1 -1
  412. package/resources/steps/messages.mjs +5 -1
  413. package/resources/steps/messages.mjs.map +1 -1
  414. package/resources/steps/steps.d.mts +17 -44
  415. package/resources/steps/steps.d.mts.map +1 -1
  416. package/resources/steps/steps.d.ts +17 -44
  417. package/resources/steps/steps.d.ts.map +1 -1
  418. package/resources/steps/steps.js +3 -11
  419. package/resources/steps/steps.js.map +1 -1
  420. package/resources/steps/steps.mjs +3 -11
  421. package/resources/steps/steps.mjs.map +1 -1
  422. package/resources/templates/agents.d.mts +9 -14
  423. package/resources/templates/agents.d.mts.map +1 -1
  424. package/resources/templates/agents.d.ts +9 -14
  425. package/resources/templates/agents.d.ts.map +1 -1
  426. package/resources/templates/agents.js +2 -3
  427. package/resources/templates/agents.js.map +1 -1
  428. package/resources/templates/agents.mjs +2 -3
  429. package/resources/templates/agents.mjs.map +1 -1
  430. package/resources/tools.d.mts +6 -68
  431. package/resources/tools.d.mts.map +1 -1
  432. package/resources/tools.d.ts +6 -68
  433. package/resources/tools.d.ts.map +1 -1
  434. package/resources/tools.js +2 -7
  435. package/resources/tools.js.map +1 -1
  436. package/resources/tools.mjs +2 -7
  437. package/resources/tools.mjs.map +1 -1
  438. package/src/client.ts +274 -127
  439. package/src/core/pagination.ts +334 -0
  440. package/src/core/streaming.ts +331 -0
  441. package/src/index.ts +1 -0
  442. package/src/internal/decoders/line.ts +135 -0
  443. package/src/internal/parse.ts +14 -0
  444. package/src/internal/request-options.ts +2 -0
  445. package/src/pagination.ts +2 -0
  446. package/src/resources/access-tokens.ts +163 -0
  447. package/src/resources/agents/agents.ts +722 -242
  448. package/src/resources/agents/archives.ts +51 -0
  449. package/src/resources/agents/blocks.ts +50 -63
  450. package/src/resources/agents/files.ts +47 -90
  451. package/src/resources/agents/folders.ts +58 -88
  452. package/src/resources/agents/groups.ts +11 -35
  453. package/src/resources/agents/identities.ts +51 -0
  454. package/src/resources/agents/index.ts +40 -12
  455. package/src/resources/agents/messages.ts +941 -550
  456. package/src/resources/agents/tools.ts +13 -37
  457. package/src/resources/archives/archives.ts +170 -0
  458. package/src/resources/archives/index.ts +17 -0
  459. package/src/resources/archives/passages.ts +150 -0
  460. package/src/resources/archives.ts +1 -178
  461. package/src/resources/batches/batches.ts +74 -46
  462. package/src/resources/batches/index.ts +2 -2
  463. package/src/resources/batches/messages.ts +12 -37
  464. package/src/resources/blocks/agents.ts +11 -35
  465. package/src/resources/blocks/blocks.ts +130 -64
  466. package/src/resources/blocks/index.ts +3 -3
  467. package/src/resources/folders/files.ts +90 -113
  468. package/src/resources/folders/folders.ts +14 -55
  469. package/src/resources/folders/index.ts +2 -2
  470. package/src/resources/groups/groups.ts +21 -102
  471. package/src/resources/groups/index.ts +2 -4
  472. package/src/resources/groups/messages.ts +215 -103
  473. package/src/resources/identities/agents.ts +12 -35
  474. package/src/resources/identities/blocks.ts +13 -36
  475. package/src/resources/identities/identities.ts +35 -107
  476. package/src/resources/identities/index.ts +3 -4
  477. package/src/resources/identities/properties.ts +1 -1
  478. package/src/resources/index.ts +55 -18
  479. package/src/resources/mcp-servers/index.ts +25 -0
  480. package/src/resources/mcp-servers/mcp-servers.ts +460 -0
  481. package/src/resources/mcp-servers/tools.ts +69 -0
  482. package/src/resources/mcp-servers.ts +3 -0
  483. package/src/resources/models/embeddings.ts +6 -2
  484. package/src/resources/models/index.ts +2 -0
  485. package/src/resources/models/models.ts +260 -3
  486. package/src/resources/runs/index.ts +2 -3
  487. package/src/resources/runs/messages.ts +18 -37
  488. package/src/resources/runs/runs.ts +14 -54
  489. package/src/resources/runs/steps.ts +11 -33
  490. package/src/resources/steps/index.ts +7 -2
  491. package/src/resources/steps/messages.ts +25 -35
  492. package/src/resources/steps/steps.ts +20 -61
  493. package/src/resources/templates/agents.ts +14 -17
  494. package/src/resources/tools.ts +8 -92
  495. package/src/streaming.ts +2 -0
  496. package/src/version.ts +1 -1
  497. package/streaming.d.mts +2 -0
  498. package/streaming.d.mts.map +1 -0
  499. package/streaming.d.ts +2 -0
  500. package/streaming.d.ts.map +1 -0
  501. package/streaming.js +6 -0
  502. package/streaming.js.map +1 -0
  503. package/streaming.mjs +2 -0
  504. package/streaming.mjs.map +1 -0
  505. package/version.d.mts +1 -1
  506. package/version.d.mts.map +1 -1
  507. package/version.d.ts +1 -1
  508. package/version.d.ts.map +1 -1
  509. package/version.js +1 -1
  510. package/version.js.map +1 -1
  511. package/version.mjs +1 -1
  512. 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;
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
+ }
583
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.
599
765
  */
600
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
766
+ text: string;
601
767
 
768
+ /**
769
+ * Stores a unique identifier for any reasoning associated with this text content.
770
+ */
771
+ signature?: string | null;
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,146 @@ export namespace Message {
899
1079
  text: string;
900
1080
  }
901
1081
  }
1082
+ }
902
1083
 
903
- export interface ToolCall {
904
- id: string;
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.LettaErrorMessage
1100
+ | LettaStreamingResponse.LettaStopReason
1101
+ | LettaStreamingResponse.LettaUsageStatistics;
905
1102
 
906
- function: ToolCall.Function;
1103
+ export namespace LettaStreamingResponse {
1104
+ /**
1105
+ * Ping messages are a keep-alive to prevent SSE streams from timing out during
1106
+ * long running requests.
1107
+ */
1108
+ export interface LettaPing {
1109
+ /**
1110
+ * The type of the message.
1111
+ */
1112
+ message_type: 'ping';
1113
+ }
907
1114
 
908
- type: 'function';
1115
+ /**
1116
+ * Error messages are used to notify the client of an error that occurred during
1117
+ * the agent's execution.
1118
+ */
1119
+ export interface LettaErrorMessage {
1120
+ /**
1121
+ * The type of error.
1122
+ */
1123
+ error_type: string;
909
1124
 
910
- [k: string]: unknown;
911
- }
1125
+ /**
1126
+ * The error message.
1127
+ */
1128
+ message: string;
912
1129
 
913
- export namespace ToolCall {
914
- export interface Function {
915
- arguments: string;
1130
+ /**
1131
+ * The type of the message.
1132
+ */
1133
+ message_type: 'error_message';
916
1134
 
917
- name: string;
1135
+ /**
1136
+ * The ID of the run.
1137
+ */
1138
+ run_id: string;
918
1139
 
919
- [k: string]: unknown;
920
- }
1140
+ /**
1141
+ * An optional error detail.
1142
+ */
1143
+ detail?: string;
921
1144
  }
922
1145
 
923
- export interface ToolReturn {
1146
+ /**
1147
+ * The stop reason from Letta indicating why agent loop stopped execution.
1148
+ */
1149
+ export interface LettaStopReason {
924
1150
  /**
925
- * The status of the tool call
1151
+ * The reason why execution stopped.
926
1152
  */
927
- status: 'success' | 'error';
1153
+ stop_reason: RunsAPI.StopReasonType;
928
1154
 
929
1155
  /**
930
- * The function response string
1156
+ * The type of the message.
931
1157
  */
932
- func_response?: string | null;
1158
+ message_type?: 'stop_reason';
1159
+ }
933
1160
 
1161
+ /**
1162
+ * Usage statistics for the agent interaction.
1163
+ *
1164
+ * Attributes: completion_tokens (int): The number of tokens generated by the
1165
+ * agent. prompt_tokens (int): The number of tokens in the prompt. total_tokens
1166
+ * (int): The total number of tokens processed by the agent. step_count (int): The
1167
+ * number of steps taken by the agent.
1168
+ */
1169
+ export interface LettaUsageStatistics {
934
1170
  /**
935
- * Captured stderr from the tool invocation
1171
+ * The number of tokens generated by the agent.
936
1172
  */
937
- stderr?: Array<string> | null;
1173
+ completion_tokens?: number;
1174
+
1175
+ message_type?: 'usage_statistics';
938
1176
 
939
1177
  /**
940
- * Captured stdout (e.g. prints, logs) from the tool invocation
1178
+ * The number of tokens in the prompt.
941
1179
  */
942
- stdout?: Array<string> | null;
1180
+ prompt_tokens?: number;
943
1181
 
944
1182
  /**
945
- * The ID for the tool call
1183
+ * The background task run IDs associated with the agent interaction
946
1184
  */
947
- tool_call_id?: unknown;
1185
+ run_ids?: Array<string> | null;
1186
+
1187
+ /**
1188
+ * The number of steps taken by the agent.
1189
+ */
1190
+ step_count?: number;
1191
+
1192
+ /**
1193
+ * The total number of tokens processed by the agent.
1194
+ */
1195
+ total_tokens?: number;
948
1196
  }
949
1197
  }
950
1198
 
1199
+ export type LettaUserMessageContentUnion = TextContent | ImageContent;
1200
+
1201
+ /**
1202
+ * A message generated by the system. Never streamed back on a response, only used
1203
+ * for cursor pagination.
1204
+ *
1205
+ * Args: id (str): The ID of the message date (datetime): The date the message was
1206
+ * created in ISO format name (Optional[str]): The name of the sender of the
1207
+ * message content (str): The message content sent by the system
1208
+ */
1209
+ export type Message =
1210
+ | SystemMessage
1211
+ | UserMessage
1212
+ | ReasoningMessage
1213
+ | HiddenReasoningMessage
1214
+ | ToolCallMessage
1215
+ | ToolsAPI.ToolReturnMessage
1216
+ | AssistantMessage
1217
+ | ApprovalRequestMessage
1218
+ | ApprovalResponseMessage
1219
+ | SummaryMessage
1220
+ | EventMessage;
1221
+
951
1222
  export type MessageRole = 'assistant' | 'user' | 'tool' | 'function' | 'system' | 'approval';
952
1223
 
953
1224
  export type MessageType =
@@ -1063,27 +1334,17 @@ export interface RedactedReasoningContent {
1063
1334
  * Representation of a run - a conversation or processing session for an agent.
1064
1335
  * Runs track when agents process messages and maintain the relationship between
1065
1336
  * 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
1337
  */
1077
1338
  export interface Run {
1078
1339
  /**
1079
- * The unique identifier of the agent associated with the run.
1340
+ * The human-friendly ID of the Run
1080
1341
  */
1081
- agent_id: string;
1342
+ id: string;
1082
1343
 
1083
1344
  /**
1084
- * The human-friendly ID of the Run
1345
+ * The unique identifier of the agent associated with the run.
1085
1346
  */
1086
- id?: string;
1347
+ agent_id: string;
1087
1348
 
1088
1349
  /**
1089
1350
  * Whether the run was created in background mode.
@@ -1185,6 +1446,34 @@ export namespace Run {
1185
1446
  }
1186
1447
  }
1187
1448
 
1449
+ /**
1450
+ * A message representing a summary of the conversation. Sent to the LLM as a user
1451
+ * or system message depending on the provider.
1452
+ */
1453
+ export interface SummaryMessage {
1454
+ id: string;
1455
+
1456
+ date: string;
1457
+
1458
+ summary: string;
1459
+
1460
+ is_err?: boolean | null;
1461
+
1462
+ message_type?: 'summary';
1463
+
1464
+ name?: string | null;
1465
+
1466
+ otid?: string | null;
1467
+
1468
+ run_id?: string | null;
1469
+
1470
+ sender_id?: string | null;
1471
+
1472
+ seq_id?: number | null;
1473
+
1474
+ step_id?: string | null;
1475
+ }
1476
+
1188
1477
  /**
1189
1478
  * A message generated by the system. Never streamed back on a response, only used
1190
1479
  * for cursor pagination.
@@ -1422,248 +1711,210 @@ export interface UserMessage {
1422
1711
 
1423
1712
  is_err?: boolean | null;
1424
1713
 
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;
1714
+ /**
1715
+ * The type of the message.
1716
+ */
1717
+ message_type?: 'user_message';
1486
1718
 
1487
- /**
1488
- * Body param:
1489
- */
1490
- message_type?: 'system_message';
1491
- }
1719
+ name?: string | null;
1492
1720
 
1493
- export interface UpdateUserMessage {
1494
- /**
1495
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1496
- */
1497
- agent_id: string;
1721
+ otid?: string | null;
1498
1722
 
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;
1723
+ run_id?: string | null;
1504
1724
 
1505
- /**
1506
- * Body param:
1507
- */
1508
- message_type?: 'user_message';
1509
- }
1725
+ sender_id?: string | null;
1510
1726
 
1511
- export interface UpdateReasoningMessage {
1512
- /**
1513
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1514
- */
1515
- agent_id: string;
1727
+ seq_id?: number | null;
1516
1728
 
1517
- /**
1518
- * Body param:
1519
- */
1520
- reasoning: string;
1729
+ step_id?: string | null;
1730
+ }
1521
1731
 
1522
- /**
1523
- * Body param:
1524
- */
1525
- message_type?: 'reasoning_message';
1526
- }
1732
+ export type MessageCancelResponse = { [key: string]: unknown };
1527
1733
 
1528
- export interface UpdateAssistantMessage {
1529
- /**
1530
- * Path param: The ID of the agent in the format 'agent-<uuid4>'
1531
- */
1532
- agent_id: string;
1734
+ export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
1533
1735
 
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;
1736
+ export interface MessageCreateParamsBase {
1737
+ /**
1738
+ * @deprecated The name of the message argument in the designated message tool.
1739
+ * Still supported for legacy agent types, but deprecated for letta_v1_agent
1740
+ * onward.
1741
+ */
1742
+ assistant_message_tool_kwarg?: string;
1539
1743
 
1540
- /**
1541
- * Body param:
1542
- */
1543
- message_type?: 'assistant_message';
1544
- }
1545
- }
1744
+ /**
1745
+ * @deprecated The name of the designated message tool. Still supported for legacy
1746
+ * agent types, but deprecated for letta_v1_agent onward.
1747
+ */
1748
+ assistant_message_tool_name?: string;
1546
1749
 
1547
- export interface MessageListParams {
1548
1750
  /**
1549
- * Message ID cursor for pagination. Returns messages that come after this message
1550
- * ID in the specified sort order
1751
+ * Whether to process the request in the background (only used when
1752
+ * streaming=true).
1551
1753
  */
1552
- after?: string | null;
1754
+ background?: boolean;
1553
1755
 
1554
1756
  /**
1555
- * @deprecated The name of the message argument.
1757
+ * @deprecated If set to True, enables reasoning before responses or tool calls
1758
+ * from the agent.
1556
1759
  */
1557
- assistant_message_tool_kwarg?: string;
1760
+ enable_thinking?: string;
1558
1761
 
1559
1762
  /**
1560
- * @deprecated The name of the designated message tool.
1763
+ * Whether to include periodic keepalive ping messages in the stream to prevent
1764
+ * connection timeouts (only used when streaming=true).
1561
1765
  */
1562
- assistant_message_tool_name?: string;
1766
+ include_pings?: boolean;
1563
1767
 
1564
1768
  /**
1565
- * Message ID cursor for pagination. Returns messages that come before this message
1566
- * ID in the specified sort order
1769
+ * Only return specified message types in the response. If `None` (default) returns
1770
+ * all messages.
1567
1771
  */
1568
- before?: string | null;
1772
+ include_return_message_types?: Array<MessageType> | null;
1569
1773
 
1570
1774
  /**
1571
- * Group ID to filter messages by.
1775
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1776
+ * 'user', 'content': input}].
1572
1777
  */
1573
- group_id?: string | null;
1778
+ input?:
1779
+ | string
1780
+ | Array<
1781
+ | TextContent
1782
+ | ImageContent
1783
+ | ToolCallContent
1784
+ | ToolReturnContent
1785
+ | ReasoningContent
1786
+ | RedactedReasoningContent
1787
+ | OmittedReasoningContent
1788
+ | MessageCreateParams.SummarizedReasoningContent
1789
+ >
1790
+ | null;
1574
1791
 
1575
1792
  /**
1576
- * Whether to include error messages and error statuses. For debugging purposes
1577
- * only.
1793
+ * Maximum number of steps the agent should take to process the request.
1578
1794
  */
1579
- include_err?: boolean | null;
1795
+ max_steps?: number;
1580
1796
 
1581
1797
  /**
1582
- * Maximum number of messages to return
1798
+ * The messages to be sent to the agent.
1583
1799
  */
1584
- limit?: number | null;
1800
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1585
1801
 
1586
1802
  /**
1587
- * Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
1588
- * newest first
1803
+ * Flag to determine if individual tokens should be streamed, rather than streaming
1804
+ * per step (only used when streaming=true).
1589
1805
  */
1590
- order?: 'asc' | 'desc';
1806
+ stream_tokens?: boolean;
1591
1807
 
1592
1808
  /**
1593
- * Field to sort by
1809
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1810
+ * returns a complete response.
1594
1811
  */
1595
- order_by?: 'created_at';
1812
+ streaming?: boolean;
1596
1813
 
1597
1814
  /**
1598
- * @deprecated Whether to use assistant messages
1815
+ * @deprecated Whether the server should parse specific tool call arguments
1816
+ * (default `send_message`) as `AssistantMessage` objects. Still supported for
1817
+ * legacy agent types, but deprecated for letta_v1_agent onward.
1599
1818
  */
1600
1819
  use_assistant_message?: boolean;
1601
1820
  }
1602
1821
 
1603
- export interface MessageCancelParams {
1822
+ export namespace MessageCreateParams {
1604
1823
  /**
1605
- * Optional list of run IDs to cancel
1824
+ * The style of reasoning content returned by the OpenAI Responses API
1606
1825
  */
1607
- run_ids?: Array<string> | null;
1826
+ export interface SummarizedReasoningContent {
1827
+ /**
1828
+ * The unique identifier for this reasoning step.
1829
+ */
1830
+ id: string;
1831
+
1832
+ /**
1833
+ * Summaries of the reasoning content.
1834
+ */
1835
+ summary: Array<SummarizedReasoningContent.Summary>;
1836
+
1837
+ /**
1838
+ * The encrypted reasoning content.
1839
+ */
1840
+ encrypted_content?: string;
1841
+
1842
+ /**
1843
+ * Indicates this is a summarized reasoning step.
1844
+ */
1845
+ type?: 'summarized_reasoning';
1846
+ }
1847
+
1848
+ export namespace SummarizedReasoningContent {
1849
+ export interface Summary {
1850
+ /**
1851
+ * The index of the summary part.
1852
+ */
1853
+ index: number;
1854
+
1855
+ /**
1856
+ * The text of the summary part.
1857
+ */
1858
+ text: string;
1859
+ }
1860
+ }
1861
+
1862
+ export type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
1863
+ export type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
1608
1864
  }
1609
1865
 
1610
- export interface MessageResetParams {
1866
+ export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
1611
1867
  /**
1612
- * If true, adds the default initial messages after resetting.
1868
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1869
+ * returns a complete response.
1613
1870
  */
1614
- add_default_initial_messages?: boolean;
1871
+ streaming?: false;
1615
1872
  }
1616
1873
 
1617
- export interface MessageSendParams {
1874
+ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
1618
1875
  /**
1619
- * The messages to be sent to the agent.
1876
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
1877
+ * returns a complete response.
1620
1878
  */
1621
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1879
+ streaming: true;
1880
+ }
1622
1881
 
1882
+ export interface MessageListParams extends ArrayPageParams {
1623
1883
  /**
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.
1884
+ * @deprecated The name of the message argument.
1627
1885
  */
1628
1886
  assistant_message_tool_kwarg?: string;
1629
1887
 
1630
1888
  /**
1631
- * @deprecated The name of the designated message tool. Still supported for legacy
1632
- * agent types, but deprecated for letta_v1_agent onward.
1889
+ * @deprecated The name of the designated message tool.
1633
1890
  */
1634
1891
  assistant_message_tool_name?: string;
1635
1892
 
1636
1893
  /**
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.
1894
+ * Group ID to filter messages by.
1645
1895
  */
1646
- include_return_message_types?: Array<MessageType> | null;
1896
+ group_id?: string | null;
1647
1897
 
1648
1898
  /**
1649
- * Maximum number of steps the agent should take to process the request.
1899
+ * Whether to include error messages and error statuses. For debugging purposes
1900
+ * only.
1650
1901
  */
1651
- max_steps?: number;
1902
+ include_err?: boolean | null;
1652
1903
 
1653
1904
  /**
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.
1905
+ * @deprecated Whether to use assistant messages
1657
1906
  */
1658
1907
  use_assistant_message?: boolean;
1659
1908
  }
1660
1909
 
1661
- export interface MessageSendAsyncParams {
1910
+ export interface MessageCancelParams {
1662
1911
  /**
1663
- * The messages to be sent to the agent.
1912
+ * Optional list of run IDs to cancel
1664
1913
  */
1665
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
1914
+ run_ids?: Array<string> | null;
1915
+ }
1666
1916
 
1917
+ export interface MessageCreateAsyncParams {
1667
1918
  /**
1668
1919
  * @deprecated The name of the message argument in the designated message tool.
1669
1920
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1694,11 +1945,34 @@ export interface MessageSendAsyncParams {
1694
1945
  */
1695
1946
  include_return_message_types?: Array<MessageType> | null;
1696
1947
 
1948
+ /**
1949
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
1950
+ * 'user', 'content': input}].
1951
+ */
1952
+ input?:
1953
+ | string
1954
+ | Array<
1955
+ | TextContent
1956
+ | ImageContent
1957
+ | ToolCallContent
1958
+ | ToolReturnContent
1959
+ | ReasoningContent
1960
+ | RedactedReasoningContent
1961
+ | OmittedReasoningContent
1962
+ | MessageCreateAsyncParams.SummarizedReasoningContent
1963
+ >
1964
+ | null;
1965
+
1697
1966
  /**
1698
1967
  * Maximum number of steps the agent should take to process the request.
1699
1968
  */
1700
1969
  max_steps?: number;
1701
1970
 
1971
+ /**
1972
+ * The messages to be sent to the agent.
1973
+ */
1974
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
1975
+
1702
1976
  /**
1703
1977
  * @deprecated Whether the server should parse specific tool call arguments
1704
1978
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1707,12 +1981,55 @@ export interface MessageSendAsyncParams {
1707
1981
  use_assistant_message?: boolean;
1708
1982
  }
1709
1983
 
1710
- export interface MessageStreamParams {
1984
+ export namespace MessageCreateAsyncParams {
1711
1985
  /**
1712
- * The messages to be sent to the agent.
1986
+ * The style of reasoning content returned by the OpenAI Responses API
1987
+ */
1988
+ export interface SummarizedReasoningContent {
1989
+ /**
1990
+ * The unique identifier for this reasoning step.
1991
+ */
1992
+ id: string;
1993
+
1994
+ /**
1995
+ * Summaries of the reasoning content.
1996
+ */
1997
+ summary: Array<SummarizedReasoningContent.Summary>;
1998
+
1999
+ /**
2000
+ * The encrypted reasoning content.
2001
+ */
2002
+ encrypted_content?: string;
2003
+
2004
+ /**
2005
+ * Indicates this is a summarized reasoning step.
2006
+ */
2007
+ type?: 'summarized_reasoning';
2008
+ }
2009
+
2010
+ export namespace SummarizedReasoningContent {
2011
+ export interface Summary {
2012
+ /**
2013
+ * The index of the summary part.
2014
+ */
2015
+ index: number;
2016
+
2017
+ /**
2018
+ * The text of the summary part.
2019
+ */
2020
+ text: string;
2021
+ }
2022
+ }
2023
+ }
2024
+
2025
+ export interface MessageResetParams {
2026
+ /**
2027
+ * If true, adds the default initial messages after resetting.
1713
2028
  */
1714
- messages: Array<AgentsAPI.MessageCreate | ApprovalCreate>;
2029
+ add_default_initial_messages?: boolean;
2030
+ }
1715
2031
 
2032
+ export interface MessageStreamParams {
1716
2033
  /**
1717
2034
  * @deprecated The name of the message argument in the designated message tool.
1718
2035
  * Still supported for legacy agent types, but deprecated for letta_v1_agent
@@ -1727,7 +2044,8 @@ export interface MessageStreamParams {
1727
2044
  assistant_message_tool_name?: string;
1728
2045
 
1729
2046
  /**
1730
- * Whether to process the request in the background.
2047
+ * Whether to process the request in the background (only used when
2048
+ * streaming=true).
1731
2049
  */
1732
2050
  background?: boolean;
1733
2051
 
@@ -1739,7 +2057,7 @@ export interface MessageStreamParams {
1739
2057
 
1740
2058
  /**
1741
2059
  * Whether to include periodic keepalive ping messages in the stream to prevent
1742
- * connection timeouts.
2060
+ * connection timeouts (only used when streaming=true).
1743
2061
  */
1744
2062
  include_pings?: boolean;
1745
2063
 
@@ -1749,17 +2067,46 @@ export interface MessageStreamParams {
1749
2067
  */
1750
2068
  include_return_message_types?: Array<MessageType> | null;
1751
2069
 
2070
+ /**
2071
+ * Syntactic sugar for a single user message. Equivalent to messages=[{'role':
2072
+ * 'user', 'content': input}].
2073
+ */
2074
+ input?:
2075
+ | string
2076
+ | Array<
2077
+ | TextContent
2078
+ | ImageContent
2079
+ | ToolCallContent
2080
+ | ToolReturnContent
2081
+ | ReasoningContent
2082
+ | RedactedReasoningContent
2083
+ | OmittedReasoningContent
2084
+ | MessageStreamParams.SummarizedReasoningContent
2085
+ >
2086
+ | null;
2087
+
1752
2088
  /**
1753
2089
  * Maximum number of steps the agent should take to process the request.
1754
2090
  */
1755
2091
  max_steps?: number;
1756
2092
 
2093
+ /**
2094
+ * The messages to be sent to the agent.
2095
+ */
2096
+ messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
2097
+
1757
2098
  /**
1758
2099
  * Flag to determine if individual tokens should be streamed, rather than streaming
1759
- * per step.
2100
+ * per step (only used when streaming=true).
1760
2101
  */
1761
2102
  stream_tokens?: boolean;
1762
2103
 
2104
+ /**
2105
+ * If True, returns a streaming response (Server-Sent Events). If False (default),
2106
+ * returns a complete response.
2107
+ */
2108
+ streaming?: boolean;
2109
+
1763
2110
  /**
1764
2111
  * @deprecated Whether the server should parse specific tool call arguments
1765
2112
  * (default `send_message`) as `AssistantMessage` objects. Still supported for
@@ -1768,21 +2115,65 @@ export interface MessageStreamParams {
1768
2115
  use_assistant_message?: boolean;
1769
2116
  }
1770
2117
 
2118
+ export namespace MessageStreamParams {
2119
+ /**
2120
+ * The style of reasoning content returned by the OpenAI Responses API
2121
+ */
2122
+ export interface SummarizedReasoningContent {
2123
+ /**
2124
+ * The unique identifier for this reasoning step.
2125
+ */
2126
+ id: string;
2127
+
2128
+ /**
2129
+ * Summaries of the reasoning content.
2130
+ */
2131
+ summary: Array<SummarizedReasoningContent.Summary>;
2132
+
2133
+ /**
2134
+ * The encrypted reasoning content.
2135
+ */
2136
+ encrypted_content?: string;
2137
+
2138
+ /**
2139
+ * Indicates this is a summarized reasoning step.
2140
+ */
2141
+ type?: 'summarized_reasoning';
2142
+ }
2143
+
2144
+ export namespace SummarizedReasoningContent {
2145
+ export interface Summary {
2146
+ /**
2147
+ * The index of the summary part.
2148
+ */
2149
+ index: number;
2150
+
2151
+ /**
2152
+ * The text of the summary part.
2153
+ */
2154
+ text: string;
2155
+ }
2156
+ }
2157
+ }
2158
+
1771
2159
  export declare namespace Messages {
1772
2160
  export {
1773
2161
  type ApprovalCreate as ApprovalCreate,
1774
2162
  type ApprovalRequestMessage as ApprovalRequestMessage,
1775
2163
  type ApprovalResponseMessage as ApprovalResponseMessage,
2164
+ type ApprovalReturn as ApprovalReturn,
1776
2165
  type AssistantMessage as AssistantMessage,
2166
+ type EventMessage as EventMessage,
1777
2167
  type HiddenReasoningMessage as HiddenReasoningMessage,
1778
2168
  type ImageContent as ImageContent,
2169
+ type InternalMessage as InternalMessage,
1779
2170
  type JobStatus as JobStatus,
1780
2171
  type JobType as JobType,
1781
2172
  type LettaAssistantMessageContentUnion as LettaAssistantMessageContentUnion,
1782
- type LettaMessageUnion as LettaMessageUnion,
1783
2173
  type LettaRequest as LettaRequest,
1784
2174
  type LettaResponse as LettaResponse,
1785
2175
  type LettaStreamingRequest as LettaStreamingRequest,
2176
+ type LettaStreamingResponse as LettaStreamingResponse,
1786
2177
  type LettaUserMessageContentUnion as LettaUserMessageContentUnion,
1787
2178
  type Message as Message,
1788
2179
  type MessageRole as MessageRole,
@@ -1792,6 +2183,7 @@ export declare namespace Messages {
1792
2183
  type ReasoningMessage as ReasoningMessage,
1793
2184
  type RedactedReasoningContent as RedactedReasoningContent,
1794
2185
  type Run as Run,
2186
+ type SummaryMessage as SummaryMessage,
1795
2187
  type SystemMessage as SystemMessage,
1796
2188
  type TextContent as TextContent,
1797
2189
  type ToolCall as ToolCall,
@@ -1805,16 +2197,15 @@ export declare namespace Messages {
1805
2197
  type UpdateSystemMessage as UpdateSystemMessage,
1806
2198
  type UpdateUserMessage as UpdateUserMessage,
1807
2199
  type UserMessage as UserMessage,
1808
- type MessageUpdateResponse as MessageUpdateResponse,
1809
- type MessageListResponse as MessageListResponse,
1810
2200
  type MessageCancelResponse as MessageCancelResponse,
1811
- type MessageStreamResponse as MessageStreamResponse,
1812
- type MessageUpdateParams as MessageUpdateParams,
2201
+ type MessagesArrayPage as MessagesArrayPage,
2202
+ type MessageCreateParams as MessageCreateParams,
2203
+ type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming,
2204
+ type MessageCreateParamsStreaming as MessageCreateParamsStreaming,
1813
2205
  type MessageListParams as MessageListParams,
1814
2206
  type MessageCancelParams as MessageCancelParams,
2207
+ type MessageCreateAsyncParams as MessageCreateAsyncParams,
1815
2208
  type MessageResetParams as MessageResetParams,
1816
- type MessageSendParams as MessageSendParams,
1817
- type MessageSendAsyncParams as MessageSendAsyncParams,
1818
2209
  type MessageStreamParams as MessageStreamParams,
1819
2210
  };
1820
2211
  }