@letta-ai/letta-client 0.1.170 → 0.1.173

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 (384) hide show
  1. package/README.md +16 -3
  2. package/api/errors/BadRequestError.d.ts +2 -1
  3. package/api/errors/BadRequestError.js +2 -1
  4. package/api/errors/ConflictError.d.ts +2 -1
  5. package/api/errors/ConflictError.js +2 -1
  6. package/api/errors/InternalServerError.d.ts +2 -1
  7. package/api/errors/InternalServerError.js +2 -1
  8. package/api/errors/NotFoundError.d.ts +2 -1
  9. package/api/errors/NotFoundError.js +2 -1
  10. package/api/errors/PaymentRequiredError.d.ts +2 -1
  11. package/api/errors/PaymentRequiredError.js +2 -1
  12. package/api/errors/UnprocessableEntityError.d.ts +2 -1
  13. package/api/errors/UnprocessableEntityError.js +2 -1
  14. package/api/resources/agents/client/Client.d.ts +20 -10
  15. package/api/resources/agents/client/Client.js +166 -82
  16. package/api/resources/agents/client/requests/AgentsListRequest.d.ts +1 -1
  17. package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
  18. package/api/resources/agents/client/requests/UpdateAgent.d.ts +2 -0
  19. package/api/resources/agents/resources/blocks/client/Client.d.ts +10 -5
  20. package/api/resources/agents/resources/blocks/client/Client.js +90 -45
  21. package/api/resources/agents/resources/context/client/Client.d.ts +2 -1
  22. package/api/resources/agents/resources/context/client/Client.js +18 -9
  23. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -1
  24. package/api/resources/agents/resources/coreMemory/client/Client.js +18 -9
  25. package/api/resources/agents/resources/files/client/Client.d.ts +6 -3
  26. package/api/resources/agents/resources/files/client/Client.js +45 -21
  27. package/api/resources/agents/resources/folders/client/Client.d.ts +6 -3
  28. package/api/resources/agents/resources/folders/client/Client.js +54 -27
  29. package/api/resources/agents/resources/groups/client/Client.d.ts +2 -1
  30. package/api/resources/agents/resources/groups/client/Client.js +19 -10
  31. package/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -1
  32. package/api/resources/agents/resources/memoryVariables/client/Client.js +18 -9
  33. package/api/resources/agents/resources/messages/client/Client.d.ts +16 -8
  34. package/api/resources/agents/resources/messages/client/Client.js +155 -83
  35. package/api/resources/agents/resources/passages/client/Client.d.ts +8 -4
  36. package/api/resources/agents/resources/passages/client/Client.js +64 -31
  37. package/api/resources/agents/resources/passages/client/requests/PassageUpdate.d.ts +2 -2
  38. package/api/resources/agents/resources/sources/client/Client.d.ts +6 -3
  39. package/api/resources/agents/resources/sources/client/Client.js +54 -27
  40. package/api/resources/agents/resources/templates/client/Client.d.ts +6 -3
  41. package/api/resources/agents/resources/templates/client/Client.js +54 -27
  42. package/api/resources/agents/resources/tools/client/Client.d.ts +6 -3
  43. package/api/resources/agents/resources/tools/client/Client.js +54 -27
  44. package/api/resources/batches/client/Client.d.ts +8 -4
  45. package/api/resources/batches/client/Client.js +63 -30
  46. package/api/resources/blocks/client/Client.d.ts +12 -6
  47. package/api/resources/blocks/client/Client.js +100 -49
  48. package/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
  49. package/api/resources/blocks/resources/agents/client/Client.js +19 -10
  50. package/api/resources/clientSideAccessTokens/client/Client.d.ts +6 -3
  51. package/api/resources/clientSideAccessTokens/client/Client.js +46 -22
  52. package/api/resources/embeddingModels/client/Client.d.ts +2 -1
  53. package/api/resources/embeddingModels/client/Client.js +18 -9
  54. package/api/resources/folders/client/Client.d.ts +18 -9
  55. package/api/resources/folders/client/Client.js +154 -76
  56. package/api/resources/folders/resources/files/client/Client.d.ts +6 -3
  57. package/api/resources/folders/resources/files/client/Client.js +48 -24
  58. package/api/resources/folders/resources/passages/client/Client.d.ts +2 -1
  59. package/api/resources/folders/resources/passages/client/Client.js +19 -10
  60. package/api/resources/groups/client/Client.d.ts +12 -6
  61. package/api/resources/groups/client/Client.js +105 -52
  62. package/api/resources/groups/resources/messages/client/Client.d.ts +10 -5
  63. package/api/resources/groups/resources/messages/client/Client.js +91 -49
  64. package/api/resources/health/client/Client.d.ts +2 -1
  65. package/api/resources/health/client/Client.js +17 -8
  66. package/api/resources/identities/client/Client.d.ts +14 -7
  67. package/api/resources/identities/client/Client.js +123 -61
  68. package/api/resources/identities/resources/properties/client/Client.d.ts +2 -1
  69. package/api/resources/identities/resources/properties/client/Client.js +9 -3
  70. package/api/resources/jobs/client/Client.d.ts +10 -5
  71. package/api/resources/jobs/client/Client.js +92 -47
  72. package/api/resources/messages/client/Client.d.ts +2 -1
  73. package/api/resources/messages/client/Client.js +19 -10
  74. package/api/resources/models/client/Client.d.ts +2 -1
  75. package/api/resources/models/client/Client.js +27 -14
  76. package/api/resources/projects/client/Client.d.ts +2 -1
  77. package/api/resources/projects/client/Client.js +18 -9
  78. package/api/resources/providers/client/Client.d.ts +10 -5
  79. package/api/resources/providers/client/Client.js +77 -36
  80. package/api/resources/runs/client/Client.d.ts +8 -4
  81. package/api/resources/runs/client/Client.js +74 -38
  82. package/api/resources/runs/resources/messages/client/Client.d.ts +2 -1
  83. package/api/resources/runs/resources/messages/client/Client.js +21 -12
  84. package/api/resources/runs/resources/steps/client/Client.d.ts +2 -1
  85. package/api/resources/runs/resources/steps/client/Client.js +19 -10
  86. package/api/resources/runs/resources/usage/client/Client.d.ts +2 -1
  87. package/api/resources/runs/resources/usage/client/Client.js +18 -9
  88. package/api/resources/sources/client/Client.d.ts +20 -10
  89. package/api/resources/sources/client/Client.js +173 -86
  90. package/api/resources/sources/resources/files/client/Client.d.ts +6 -3
  91. package/api/resources/sources/resources/files/client/Client.js +48 -24
  92. package/api/resources/sources/resources/passages/client/Client.d.ts +2 -1
  93. package/api/resources/sources/resources/passages/client/Client.js +19 -10
  94. package/api/resources/steps/client/Client.d.ts +4 -2
  95. package/api/resources/steps/client/Client.js +41 -21
  96. package/api/resources/steps/resources/feedback/client/Client.d.ts +2 -1
  97. package/api/resources/steps/resources/feedback/client/Client.js +23 -12
  98. package/api/resources/tags/client/Client.d.ts +2 -1
  99. package/api/resources/tags/client/Client.js +19 -10
  100. package/api/resources/telemetry/client/Client.d.ts +2 -1
  101. package/api/resources/telemetry/client/Client.js +18 -9
  102. package/api/resources/templates/client/Client.d.ts +2 -1
  103. package/api/resources/templates/client/Client.js +18 -9
  104. package/api/resources/templates/resources/agents/client/Client.d.ts +2 -1
  105. package/api/resources/templates/resources/agents/client/Client.js +19 -10
  106. package/api/resources/tools/client/Client.d.ts +40 -20
  107. package/api/resources/tools/client/Client.js +356 -182
  108. package/api/resources/tools/client/requests/ToolRunFromSource.d.ts +2 -0
  109. package/api/resources/tools/client/requests/ToolUpdate.d.ts +2 -0
  110. package/api/resources/voice/client/Client.d.ts +2 -1
  111. package/api/resources/voice/client/Client.js +9 -3
  112. package/api/types/AgentState.d.ts +2 -0
  113. package/api/types/EmbeddingConfig.d.ts +1 -11
  114. package/api/types/LettaStreamingRequest.d.ts +2 -0
  115. package/api/types/LlmConfig.d.ts +1 -11
  116. package/api/types/ModalSandboxConfig.d.ts +4 -0
  117. package/api/types/ModalSandboxConfigLanguage.d.ts +8 -0
  118. package/api/types/ModalSandboxConfigLanguage.js +10 -0
  119. package/api/types/NpmRequirement.d.ts +9 -0
  120. package/api/types/NpmRequirement.js +5 -0
  121. package/api/types/Passage.d.ts +4 -4
  122. package/api/types/Tool.d.ts +2 -0
  123. package/api/types/ToolCreate.d.ts +2 -0
  124. package/api/types/ToolType.d.ts +2 -1
  125. package/api/types/ToolType.js +1 -0
  126. package/api/types/index.d.ts +2 -0
  127. package/api/types/index.js +2 -0
  128. package/core/fetcher/APIResponse.d.ts +10 -0
  129. package/core/fetcher/Fetcher.d.ts +1 -1
  130. package/core/fetcher/Fetcher.js +11 -3
  131. package/core/fetcher/Headers.d.ts +2 -0
  132. package/core/fetcher/Headers.js +84 -0
  133. package/core/fetcher/HttpResponsePromise.d.ts +58 -0
  134. package/core/fetcher/HttpResponsePromise.js +103 -0
  135. package/core/fetcher/RawResponse.d.ts +29 -0
  136. package/core/fetcher/RawResponse.js +44 -0
  137. package/core/fetcher/createRequestUrl.d.ts +1 -1
  138. package/core/fetcher/getRequestBody.js +2 -1
  139. package/core/fetcher/index.d.ts +3 -0
  140. package/core/fetcher/index.js +7 -1
  141. package/core/fetcher/requestWithRetries.js +1 -1
  142. package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  143. package/core/form-data-utils/FormDataWrapper.js +53 -10
  144. package/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
  145. package/core/form-data-utils/encodeAsFormParameter.js +18 -0
  146. package/core/form-data-utils/index.d.ts +1 -0
  147. package/core/form-data-utils/index.js +3 -0
  148. package/core/json.d.ts +15 -0
  149. package/core/json.js +24 -0
  150. package/core/schemas/Schema.d.ts +2 -0
  151. package/core/schemas/Schema.js +2 -0
  152. package/core/schemas/builders/bigint/bigint.d.ts +1 -1
  153. package/core/schemas/builders/bigint/bigint.js +21 -17
  154. package/core/schemas/builders/object/object.js +1 -0
  155. package/core/schemas/builders/record/record.js +1 -2
  156. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
  157. package/core/schemas/builders/schema-utils/getSchemaUtils.js +64 -0
  158. package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +1 -1
  159. package/dist/api/errors/BadRequestError.d.ts +2 -1
  160. package/dist/api/errors/BadRequestError.js +2 -1
  161. package/dist/api/errors/ConflictError.d.ts +2 -1
  162. package/dist/api/errors/ConflictError.js +2 -1
  163. package/dist/api/errors/InternalServerError.d.ts +2 -1
  164. package/dist/api/errors/InternalServerError.js +2 -1
  165. package/dist/api/errors/NotFoundError.d.ts +2 -1
  166. package/dist/api/errors/NotFoundError.js +2 -1
  167. package/dist/api/errors/PaymentRequiredError.d.ts +2 -1
  168. package/dist/api/errors/PaymentRequiredError.js +2 -1
  169. package/dist/api/errors/UnprocessableEntityError.d.ts +2 -1
  170. package/dist/api/errors/UnprocessableEntityError.js +2 -1
  171. package/dist/api/resources/agents/client/Client.d.ts +20 -10
  172. package/dist/api/resources/agents/client/Client.js +166 -82
  173. package/dist/api/resources/agents/client/requests/AgentsListRequest.d.ts +1 -1
  174. package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
  175. package/dist/api/resources/agents/client/requests/UpdateAgent.d.ts +2 -0
  176. package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +10 -5
  177. package/dist/api/resources/agents/resources/blocks/client/Client.js +90 -45
  178. package/dist/api/resources/agents/resources/context/client/Client.d.ts +2 -1
  179. package/dist/api/resources/agents/resources/context/client/Client.js +18 -9
  180. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -1
  181. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +18 -9
  182. package/dist/api/resources/agents/resources/files/client/Client.d.ts +6 -3
  183. package/dist/api/resources/agents/resources/files/client/Client.js +45 -21
  184. package/dist/api/resources/agents/resources/folders/client/Client.d.ts +6 -3
  185. package/dist/api/resources/agents/resources/folders/client/Client.js +54 -27
  186. package/dist/api/resources/agents/resources/groups/client/Client.d.ts +2 -1
  187. package/dist/api/resources/agents/resources/groups/client/Client.js +19 -10
  188. package/dist/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -1
  189. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +18 -9
  190. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +16 -8
  191. package/dist/api/resources/agents/resources/messages/client/Client.js +155 -83
  192. package/dist/api/resources/agents/resources/passages/client/Client.d.ts +8 -4
  193. package/dist/api/resources/agents/resources/passages/client/Client.js +64 -31
  194. package/dist/api/resources/agents/resources/passages/client/requests/PassageUpdate.d.ts +2 -2
  195. package/dist/api/resources/agents/resources/sources/client/Client.d.ts +6 -3
  196. package/dist/api/resources/agents/resources/sources/client/Client.js +54 -27
  197. package/dist/api/resources/agents/resources/templates/client/Client.d.ts +6 -3
  198. package/dist/api/resources/agents/resources/templates/client/Client.js +54 -27
  199. package/dist/api/resources/agents/resources/tools/client/Client.d.ts +6 -3
  200. package/dist/api/resources/agents/resources/tools/client/Client.js +54 -27
  201. package/dist/api/resources/batches/client/Client.d.ts +8 -4
  202. package/dist/api/resources/batches/client/Client.js +63 -30
  203. package/dist/api/resources/blocks/client/Client.d.ts +12 -6
  204. package/dist/api/resources/blocks/client/Client.js +100 -49
  205. package/dist/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
  206. package/dist/api/resources/blocks/resources/agents/client/Client.js +19 -10
  207. package/dist/api/resources/clientSideAccessTokens/client/Client.d.ts +6 -3
  208. package/dist/api/resources/clientSideAccessTokens/client/Client.js +46 -22
  209. package/dist/api/resources/embeddingModels/client/Client.d.ts +2 -1
  210. package/dist/api/resources/embeddingModels/client/Client.js +18 -9
  211. package/dist/api/resources/folders/client/Client.d.ts +18 -9
  212. package/dist/api/resources/folders/client/Client.js +154 -76
  213. package/dist/api/resources/folders/resources/files/client/Client.d.ts +6 -3
  214. package/dist/api/resources/folders/resources/files/client/Client.js +48 -24
  215. package/dist/api/resources/folders/resources/passages/client/Client.d.ts +2 -1
  216. package/dist/api/resources/folders/resources/passages/client/Client.js +19 -10
  217. package/dist/api/resources/groups/client/Client.d.ts +12 -6
  218. package/dist/api/resources/groups/client/Client.js +105 -52
  219. package/dist/api/resources/groups/resources/messages/client/Client.d.ts +10 -5
  220. package/dist/api/resources/groups/resources/messages/client/Client.js +91 -49
  221. package/dist/api/resources/health/client/Client.d.ts +2 -1
  222. package/dist/api/resources/health/client/Client.js +17 -8
  223. package/dist/api/resources/identities/client/Client.d.ts +14 -7
  224. package/dist/api/resources/identities/client/Client.js +123 -61
  225. package/dist/api/resources/identities/resources/properties/client/Client.d.ts +2 -1
  226. package/dist/api/resources/identities/resources/properties/client/Client.js +9 -3
  227. package/dist/api/resources/jobs/client/Client.d.ts +10 -5
  228. package/dist/api/resources/jobs/client/Client.js +92 -47
  229. package/dist/api/resources/messages/client/Client.d.ts +2 -1
  230. package/dist/api/resources/messages/client/Client.js +19 -10
  231. package/dist/api/resources/models/client/Client.d.ts +2 -1
  232. package/dist/api/resources/models/client/Client.js +27 -14
  233. package/dist/api/resources/projects/client/Client.d.ts +2 -1
  234. package/dist/api/resources/projects/client/Client.js +18 -9
  235. package/dist/api/resources/providers/client/Client.d.ts +10 -5
  236. package/dist/api/resources/providers/client/Client.js +77 -36
  237. package/dist/api/resources/runs/client/Client.d.ts +8 -4
  238. package/dist/api/resources/runs/client/Client.js +74 -38
  239. package/dist/api/resources/runs/resources/messages/client/Client.d.ts +2 -1
  240. package/dist/api/resources/runs/resources/messages/client/Client.js +21 -12
  241. package/dist/api/resources/runs/resources/steps/client/Client.d.ts +2 -1
  242. package/dist/api/resources/runs/resources/steps/client/Client.js +19 -10
  243. package/dist/api/resources/runs/resources/usage/client/Client.d.ts +2 -1
  244. package/dist/api/resources/runs/resources/usage/client/Client.js +18 -9
  245. package/dist/api/resources/sources/client/Client.d.ts +20 -10
  246. package/dist/api/resources/sources/client/Client.js +173 -86
  247. package/dist/api/resources/sources/resources/files/client/Client.d.ts +6 -3
  248. package/dist/api/resources/sources/resources/files/client/Client.js +48 -24
  249. package/dist/api/resources/sources/resources/passages/client/Client.d.ts +2 -1
  250. package/dist/api/resources/sources/resources/passages/client/Client.js +19 -10
  251. package/dist/api/resources/steps/client/Client.d.ts +4 -2
  252. package/dist/api/resources/steps/client/Client.js +41 -21
  253. package/dist/api/resources/steps/resources/feedback/client/Client.d.ts +2 -1
  254. package/dist/api/resources/steps/resources/feedback/client/Client.js +23 -12
  255. package/dist/api/resources/tags/client/Client.d.ts +2 -1
  256. package/dist/api/resources/tags/client/Client.js +19 -10
  257. package/dist/api/resources/telemetry/client/Client.d.ts +2 -1
  258. package/dist/api/resources/telemetry/client/Client.js +18 -9
  259. package/dist/api/resources/templates/client/Client.d.ts +2 -1
  260. package/dist/api/resources/templates/client/Client.js +18 -9
  261. package/dist/api/resources/templates/resources/agents/client/Client.d.ts +2 -1
  262. package/dist/api/resources/templates/resources/agents/client/Client.js +19 -10
  263. package/dist/api/resources/tools/client/Client.d.ts +40 -20
  264. package/dist/api/resources/tools/client/Client.js +356 -182
  265. package/dist/api/resources/tools/client/requests/ToolRunFromSource.d.ts +2 -0
  266. package/dist/api/resources/tools/client/requests/ToolUpdate.d.ts +2 -0
  267. package/dist/api/resources/voice/client/Client.d.ts +2 -1
  268. package/dist/api/resources/voice/client/Client.js +9 -3
  269. package/dist/api/types/AgentState.d.ts +2 -0
  270. package/dist/api/types/EmbeddingConfig.d.ts +1 -11
  271. package/dist/api/types/LettaStreamingRequest.d.ts +2 -0
  272. package/dist/api/types/LlmConfig.d.ts +1 -11
  273. package/dist/api/types/ModalSandboxConfig.d.ts +4 -0
  274. package/dist/api/types/ModalSandboxConfigLanguage.d.ts +8 -0
  275. package/dist/api/types/ModalSandboxConfigLanguage.js +10 -0
  276. package/dist/api/types/NpmRequirement.d.ts +9 -0
  277. package/dist/api/types/NpmRequirement.js +5 -0
  278. package/dist/api/types/Passage.d.ts +4 -4
  279. package/dist/api/types/Tool.d.ts +2 -0
  280. package/dist/api/types/ToolCreate.d.ts +2 -0
  281. package/dist/api/types/ToolType.d.ts +2 -1
  282. package/dist/api/types/ToolType.js +1 -0
  283. package/dist/api/types/index.d.ts +2 -0
  284. package/dist/api/types/index.js +2 -0
  285. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  286. package/dist/core/fetcher/Fetcher.d.ts +1 -1
  287. package/dist/core/fetcher/Fetcher.js +11 -3
  288. package/dist/core/fetcher/Headers.d.ts +2 -0
  289. package/dist/core/fetcher/Headers.js +84 -0
  290. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  291. package/dist/core/fetcher/HttpResponsePromise.js +103 -0
  292. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  293. package/dist/core/fetcher/RawResponse.js +44 -0
  294. package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
  295. package/dist/core/fetcher/getRequestBody.js +2 -1
  296. package/dist/core/fetcher/index.d.ts +3 -0
  297. package/dist/core/fetcher/index.js +7 -1
  298. package/dist/core/fetcher/requestWithRetries.js +1 -1
  299. package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  300. package/dist/core/form-data-utils/FormDataWrapper.js +53 -10
  301. package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
  302. package/dist/core/form-data-utils/encodeAsFormParameter.js +18 -0
  303. package/dist/core/form-data-utils/index.d.ts +1 -0
  304. package/dist/core/form-data-utils/index.js +3 -0
  305. package/dist/core/json.d.ts +15 -0
  306. package/dist/core/json.js +24 -0
  307. package/dist/core/schemas/Schema.d.ts +2 -0
  308. package/dist/core/schemas/Schema.js +2 -0
  309. package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
  310. package/dist/core/schemas/builders/bigint/bigint.js +21 -17
  311. package/dist/core/schemas/builders/object/object.js +1 -0
  312. package/dist/core/schemas/builders/record/record.js +1 -2
  313. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
  314. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +64 -0
  315. package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +1 -1
  316. package/dist/errors/LettaError.d.ts +4 -1
  317. package/dist/errors/LettaError.js +6 -8
  318. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -0
  319. package/dist/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -0
  320. package/dist/serialization/resources/agents/client/requests/UpdateAgent.d.ts +1 -0
  321. package/dist/serialization/resources/agents/client/requests/UpdateAgent.js +1 -0
  322. package/dist/serialization/resources/agents/resources/passages/client/requests/PassageUpdate.d.ts +1 -1
  323. package/dist/serialization/resources/agents/resources/passages/client/requests/PassageUpdate.js +1 -1
  324. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.d.ts +2 -0
  325. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.js +2 -0
  326. package/dist/serialization/resources/tools/client/requests/ToolUpdate.d.ts +2 -0
  327. package/dist/serialization/resources/tools/client/requests/ToolUpdate.js +2 -0
  328. package/dist/serialization/types/AgentState.d.ts +1 -0
  329. package/dist/serialization/types/AgentState.js +1 -0
  330. package/dist/serialization/types/LettaStreamingRequest.d.ts +1 -0
  331. package/dist/serialization/types/LettaStreamingRequest.js +1 -0
  332. package/dist/serialization/types/ModalSandboxConfig.d.ts +3 -0
  333. package/dist/serialization/types/ModalSandboxConfig.js +3 -0
  334. package/dist/serialization/types/ModalSandboxConfigLanguage.d.ts +10 -0
  335. package/dist/serialization/types/ModalSandboxConfigLanguage.js +41 -0
  336. package/dist/serialization/types/NpmRequirement.d.ts +13 -0
  337. package/dist/serialization/types/NpmRequirement.js +44 -0
  338. package/dist/serialization/types/Passage.d.ts +1 -1
  339. package/dist/serialization/types/Passage.js +1 -1
  340. package/dist/serialization/types/Tool.d.ts +2 -0
  341. package/dist/serialization/types/Tool.js +2 -0
  342. package/dist/serialization/types/ToolCreate.d.ts +2 -0
  343. package/dist/serialization/types/ToolCreate.js +2 -0
  344. package/dist/serialization/types/ToolType.d.ts +1 -1
  345. package/dist/serialization/types/ToolType.js +1 -0
  346. package/dist/serialization/types/index.d.ts +2 -0
  347. package/dist/serialization/types/index.js +2 -0
  348. package/dist/version.d.ts +1 -1
  349. package/dist/version.js +1 -1
  350. package/errors/LettaError.d.ts +4 -1
  351. package/errors/LettaError.js +6 -8
  352. package/package.json +4 -4
  353. package/serialization/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -0
  354. package/serialization/resources/agents/client/requests/CreateAgentRequest.js +1 -0
  355. package/serialization/resources/agents/client/requests/UpdateAgent.d.ts +1 -0
  356. package/serialization/resources/agents/client/requests/UpdateAgent.js +1 -0
  357. package/serialization/resources/agents/resources/passages/client/requests/PassageUpdate.d.ts +1 -1
  358. package/serialization/resources/agents/resources/passages/client/requests/PassageUpdate.js +1 -1
  359. package/serialization/resources/tools/client/requests/ToolRunFromSource.d.ts +2 -0
  360. package/serialization/resources/tools/client/requests/ToolRunFromSource.js +2 -0
  361. package/serialization/resources/tools/client/requests/ToolUpdate.d.ts +2 -0
  362. package/serialization/resources/tools/client/requests/ToolUpdate.js +2 -0
  363. package/serialization/types/AgentState.d.ts +1 -0
  364. package/serialization/types/AgentState.js +1 -0
  365. package/serialization/types/LettaStreamingRequest.d.ts +1 -0
  366. package/serialization/types/LettaStreamingRequest.js +1 -0
  367. package/serialization/types/ModalSandboxConfig.d.ts +3 -0
  368. package/serialization/types/ModalSandboxConfig.js +3 -0
  369. package/serialization/types/ModalSandboxConfigLanguage.d.ts +10 -0
  370. package/serialization/types/ModalSandboxConfigLanguage.js +41 -0
  371. package/serialization/types/NpmRequirement.d.ts +13 -0
  372. package/serialization/types/NpmRequirement.js +44 -0
  373. package/serialization/types/Passage.d.ts +1 -1
  374. package/serialization/types/Passage.js +1 -1
  375. package/serialization/types/Tool.d.ts +2 -0
  376. package/serialization/types/Tool.js +2 -0
  377. package/serialization/types/ToolCreate.d.ts +2 -0
  378. package/serialization/types/ToolCreate.js +2 -0
  379. package/serialization/types/ToolType.d.ts +1 -1
  380. package/serialization/types/ToolType.js +1 -0
  381. package/serialization/types/index.d.ts +2 -0
  382. package/serialization/types/index.js +2 -0
  383. package/version.d.ts +1 -1
  384. package/version.js +1 -1
package/README.md CHANGED
@@ -56,6 +56,7 @@ try {
56
56
  console.log(err.statusCode);
57
57
  console.log(err.message);
58
58
  console.log(err.body);
59
+ console.log(err.rawResponse);
59
60
  }
60
61
  }
61
62
  ```
@@ -77,10 +78,10 @@ const response = await client.tools.create(..., {
77
78
  ### Retries
78
79
 
79
80
  The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
80
- as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
81
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
81
82
  retry limit (default: 2).
82
83
 
83
- A request is deemed retriable when any of the following HTTP status codes is returned:
84
+ A request is deemed retryable when any of the following HTTP status codes is returned:
84
85
 
85
86
  - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
86
87
  - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
@@ -116,6 +117,18 @@ const response = await client.tools.create(..., {
116
117
  controller.abort(); // aborts the request
117
118
  ```
118
119
 
120
+ ### Access Raw Response Data
121
+
122
+ The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
123
+ The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
124
+
125
+ ```typescript
126
+ const { data, rawResponse } = await client.tools.create(...).withRawResponse();
127
+
128
+ console.log(data);
129
+ console.log(rawResponse.headers['X-My-Header']);
130
+ ```
131
+
119
132
  ### Runtime Compatibility
120
133
 
121
134
  The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
@@ -130,7 +143,7 @@ runtimes:
130
143
 
131
144
  ### Customizing Fetch Client
132
145
 
133
- The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
146
+ The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an
134
147
  unsupported environment, this provides a way for you to break glass and ensure the SDK works.
135
148
 
136
149
  ```typescript
@@ -2,6 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
+ import * as core from "../../core";
5
6
  export declare class BadRequestError extends errors.LettaError {
6
- constructor(body?: unknown);
7
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
7
8
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.BadRequestError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
41
  class BadRequestError extends errors.LettaError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "BadRequestError",
45
45
  statusCode: 400,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, BadRequestError.prototype);
49
50
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
5
  import * as Letta from "../index";
6
+ import * as core from "../../core";
6
7
  export declare class ConflictError extends errors.LettaError {
7
- constructor(body: Letta.ConflictErrorBody);
8
+ constructor(body: Letta.ConflictErrorBody, rawResponse?: core.RawResponse);
8
9
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ConflictError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
41
  class ConflictError extends errors.LettaError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "ConflictError",
45
45
  statusCode: 409,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, ConflictError.prototype);
49
50
  }
@@ -2,6 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
+ import * as core from "../../core";
5
6
  export declare class InternalServerError extends errors.LettaError {
6
- constructor(body?: unknown);
7
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
7
8
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.InternalServerError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
41
  class InternalServerError extends errors.LettaError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "InternalServerError",
45
45
  statusCode: 500,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, InternalServerError.prototype);
49
50
  }
@@ -2,6 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
+ import * as core from "../../core";
5
6
  export declare class NotFoundError extends errors.LettaError {
6
- constructor(body?: unknown);
7
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
7
8
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.NotFoundError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
41
  class NotFoundError extends errors.LettaError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "NotFoundError",
45
45
  statusCode: 404,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, NotFoundError.prototype);
49
50
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
5
  import * as Letta from "../index";
6
+ import * as core from "../../core";
6
7
  export declare class PaymentRequiredError extends errors.LettaError {
7
- constructor(body: Letta.PaymentRequiredErrorBody);
8
+ constructor(body: Letta.PaymentRequiredErrorBody, rawResponse?: core.RawResponse);
8
9
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.PaymentRequiredError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
41
  class PaymentRequiredError extends errors.LettaError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "PaymentRequiredError",
45
45
  statusCode: 402,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, PaymentRequiredError.prototype);
49
50
  }
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
5
  import * as Letta from "../index";
6
+ import * as core from "../../core";
6
7
  export declare class UnprocessableEntityError extends errors.LettaError {
7
- constructor(body: Letta.HttpValidationError);
8
+ constructor(body: Letta.HttpValidationError, rawResponse?: core.RawResponse);
8
9
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.UnprocessableEntityError = void 0;
40
40
  const errors = __importStar(require("../../errors/index"));
41
41
  class UnprocessableEntityError extends errors.LettaError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "UnprocessableEntityError",
45
45
  statusCode: 422,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
49
50
  }
@@ -82,7 +82,8 @@ export declare class Agents {
82
82
  * @example
83
83
  * await client.agents.list()
84
84
  */
85
- list(request?: Letta.AgentsListRequest, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState[]>;
85
+ list(request?: Letta.AgentsListRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState[]>;
86
+ private __list;
86
87
  /**
87
88
  * Create a new agent with the specified configuration.
88
89
  *
@@ -94,7 +95,8 @@ export declare class Agents {
94
95
  * @example
95
96
  * await client.agents.create()
96
97
  */
97
- create(request?: Letta.CreateAgentRequest, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState>;
98
+ create(request?: Letta.CreateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
99
+ private __create;
98
100
  /**
99
101
  * Get the count of all agents associated with a given user.
100
102
  *
@@ -105,7 +107,8 @@ export declare class Agents {
105
107
  * @example
106
108
  * await client.agents.count()
107
109
  */
108
- count(requestOptions?: Agents.RequestOptions): Promise<number>;
110
+ count(requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<number>;
111
+ private __count;
109
112
  /**
110
113
  * Export the serialized JSON representation of an agent, formatted with indentation.
111
114
  *
@@ -117,7 +120,8 @@ export declare class Agents {
117
120
  * @example
118
121
  * await client.agents.exportFile("agent_id")
119
122
  */
120
- exportFile(agentId: string, requestOptions?: Agents.RequestOptions): Promise<string>;
123
+ exportFile(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<string>;
124
+ private __exportFile;
121
125
  /**
122
126
  * Import a serialized agent file and recreate the agent in the system.
123
127
  *
@@ -130,7 +134,8 @@ export declare class Agents {
130
134
  * @example
131
135
  * await client.agents.importFile(fs.createReadStream("/path/to/your/file"), {})
132
136
  */
133
- importFile(file: File | fs.ReadStream | Blob, request: Letta.BodyImportAgentSerialized, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState>;
137
+ importFile(file: File | fs.ReadStream | Blob, request: Letta.BodyImportAgentSerialized, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
138
+ private __importFile;
134
139
  /**
135
140
  * Get the state of the agent.
136
141
  *
@@ -143,7 +148,8 @@ export declare class Agents {
143
148
  * @example
144
149
  * await client.agents.retrieve("agent_id")
145
150
  */
146
- retrieve(agentId: string, request?: Letta.AgentsRetrieveRequest, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState>;
151
+ retrieve(agentId: string, request?: Letta.AgentsRetrieveRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
152
+ private __retrieve;
147
153
  /**
148
154
  * Delete an agent.
149
155
  *
@@ -155,7 +161,8 @@ export declare class Agents {
155
161
  * @example
156
162
  * await client.agents.delete("agent_id")
157
163
  */
158
- delete(agentId: string, requestOptions?: Agents.RequestOptions): Promise<unknown>;
164
+ delete(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<unknown>;
165
+ private __delete;
159
166
  /**
160
167
  * Update an existing agent
161
168
  *
@@ -168,7 +175,8 @@ export declare class Agents {
168
175
  * @example
169
176
  * await client.agents.modify("agent_id")
170
177
  */
171
- modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentState>;
178
+ modify(agentId: string, request?: Letta.UpdateAgent, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
179
+ private __modify;
172
180
  /**
173
181
  * Summarize an agent's conversation history to a target message length.
174
182
  *
@@ -186,7 +194,8 @@ export declare class Agents {
186
194
  * maxMessageLength: 1
187
195
  * })
188
196
  */
189
- summarizeAgentConversation(agentId: string, request: Letta.SummarizeAgentConversationRequest, requestOptions?: Agents.RequestOptions): Promise<void>;
197
+ summarizeAgentConversation(agentId: string, request: Letta.SummarizeAgentConversationRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
198
+ private __summarizeAgentConversation;
190
199
  /**
191
200
  * <Note>This endpoint is only available on Letta Cloud.</Note>
192
201
  *
@@ -198,7 +207,8 @@ export declare class Agents {
198
207
  * @example
199
208
  * await client.agents.search()
200
209
  */
201
- search(request?: Letta.AgentsSearchRequest, requestOptions?: Agents.RequestOptions): Promise<Letta.AgentsSearchResponse>;
210
+ search(request?: Letta.AgentsSearchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Letta.AgentsSearchResponse>;
211
+ private __search;
202
212
  protected _getCustomAuthorizationHeaders(): Promise<{
203
213
  Authorization: string;
204
214
  }>;