@letta-ai/letta-client 0.1.13 → 0.1.15

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 (262) hide show
  1. package/api/resources/agents/client/Client.d.ts +6 -125
  2. package/api/resources/agents/client/Client.js +28 -629
  3. package/api/resources/agents/client/requests/AgentsListRequest.d.ts +5 -1
  4. package/api/resources/agents/client/requests/index.d.ts +0 -2
  5. package/api/resources/agents/resources/archivalMemory/client/Client.d.ts +21 -4
  6. package/api/resources/agents/resources/archivalMemory/client/Client.js +104 -28
  7. package/api/resources/agents/resources/archivalMemory/client/index.d.ts +1 -1
  8. package/api/resources/agents/resources/archivalMemory/client/index.js +15 -0
  9. package/api/resources/agents/{client/requests/ListArchivalMemoryRequest.d.ts → resources/archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts} +1 -1
  10. package/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +2 -0
  11. package/api/resources/agents/resources/archivalMemory/client/requests/index.js +2 -0
  12. package/api/resources/agents/resources/context/client/Client.js +1 -1
  13. package/api/resources/agents/resources/coreMemory/client/Client.d.ts +42 -15
  14. package/api/resources/agents/resources/coreMemory/client/Client.js +195 -64
  15. package/api/resources/agents/resources/index.d.ts +1 -0
  16. package/api/resources/agents/resources/index.js +1 -0
  17. package/api/resources/agents/resources/memoryVariables/client/Client.js +3 -3
  18. package/api/resources/agents/resources/messages/client/Client.d.ts +2 -2
  19. package/api/resources/agents/resources/messages/client/Client.js +7 -7
  20. package/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +1 -1
  21. package/api/resources/agents/resources/messages/client/requests/MessageUpdate.d.ts +2 -2
  22. package/api/resources/agents/resources/messages/types/MessageUpdateContent.d.ts +8 -0
  23. package/api/resources/agents/resources/messages/types/index.d.ts +1 -0
  24. package/api/resources/agents/resources/messages/types/index.js +1 -0
  25. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  26. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  27. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  28. package/api/resources/blocks/client/Client.d.ts +13 -0
  29. package/api/resources/blocks/client/Client.js +71 -5
  30. package/api/resources/health/client/Client.js +1 -1
  31. package/api/resources/jobs/client/Client.js +4 -4
  32. package/api/resources/models/client/Client.js +2 -2
  33. package/api/resources/providers/client/Client.js +7 -7
  34. package/api/resources/providers/client/requests/ListProvidersRequest.d.ts +1 -1
  35. package/api/resources/runs/client/Client.d.ts +3 -2
  36. package/api/resources/runs/client/Client.js +17 -13
  37. package/api/resources/runs/client/requests/ListRunMessagesRequest.d.ts +7 -3
  38. package/api/resources/sources/client/Client.js +6 -6
  39. package/api/resources/sources/resources/files/client/Client.js +6 -6
  40. package/api/resources/sources/resources/files/client/requests/FilesListRequest.d.ts +1 -1
  41. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  42. package/api/resources/tag/client/Client.js +4 -4
  43. package/api/resources/tag/client/requests/ListTagsRequest.d.ts +1 -1
  44. package/api/resources/tools/client/Client.js +14 -14
  45. package/api/resources/tools/client/requests/ToolsListRequest.d.ts +1 -1
  46. package/api/types/AssistantMessage.d.ts +2 -1
  47. package/api/types/AssistantMessageContent.d.ts +5 -0
  48. package/api/types/LlmConfig.d.ts +3 -0
  49. package/api/types/Message.d.ts +2 -2
  50. package/api/types/MessageCreate.d.ts +2 -2
  51. package/api/types/MessageCreateContent.d.ts +8 -0
  52. package/api/types/MessageCreateContent.js +5 -0
  53. package/api/types/SystemMessage.d.ts +3 -2
  54. package/api/types/SystemMessageContent.d.ts +5 -0
  55. package/api/types/SystemMessageContent.js +5 -0
  56. package/api/types/TextContent.d.ts +8 -0
  57. package/api/types/TextContent.js +5 -0
  58. package/api/types/UserMessage.d.ts +3 -2
  59. package/api/types/UserMessageContent.d.ts +5 -0
  60. package/api/types/UserMessageContent.js +5 -0
  61. package/api/types/index.d.ts +5 -0
  62. package/api/types/index.js +5 -0
  63. package/dist/api/resources/agents/client/Client.d.ts +6 -125
  64. package/dist/api/resources/agents/client/Client.js +28 -629
  65. package/dist/api/resources/agents/client/requests/AgentsListRequest.d.ts +5 -1
  66. package/dist/api/resources/agents/client/requests/index.d.ts +0 -2
  67. package/dist/api/resources/agents/resources/archivalMemory/client/Client.d.ts +21 -4
  68. package/dist/api/resources/agents/resources/archivalMemory/client/Client.js +104 -28
  69. package/dist/api/resources/agents/resources/archivalMemory/client/index.d.ts +1 -1
  70. package/dist/api/resources/agents/resources/archivalMemory/client/index.js +15 -0
  71. package/dist/api/resources/agents/{client/requests/ListArchivalMemoryRequest.d.ts → resources/archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts} +1 -1
  72. package/dist/api/resources/agents/resources/archivalMemory/client/requests/ArchivalMemoryListRequest.js +5 -0
  73. package/dist/api/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +5 -0
  74. package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +2 -0
  75. package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.js +2 -0
  76. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  77. package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +42 -15
  78. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +195 -64
  79. package/dist/api/resources/agents/resources/index.d.ts +1 -0
  80. package/dist/api/resources/agents/resources/index.js +1 -0
  81. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +3 -3
  82. package/dist/api/resources/agents/resources/messages/client/Client.d.ts +2 -2
  83. package/dist/api/resources/agents/resources/messages/client/Client.js +7 -7
  84. package/dist/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +1 -1
  85. package/dist/api/resources/agents/resources/messages/client/requests/MessageUpdate.d.ts +2 -2
  86. package/dist/api/resources/agents/resources/messages/types/MessageUpdateContent.d.ts +8 -0
  87. package/dist/api/resources/agents/resources/messages/types/MessageUpdateContent.js +5 -0
  88. package/dist/api/resources/agents/resources/messages/types/index.d.ts +1 -0
  89. package/dist/api/resources/agents/resources/messages/types/index.js +1 -0
  90. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  91. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  92. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  93. package/dist/api/resources/blocks/client/Client.d.ts +13 -0
  94. package/dist/api/resources/blocks/client/Client.js +71 -5
  95. package/dist/api/resources/health/client/Client.js +1 -1
  96. package/dist/api/resources/jobs/client/Client.js +4 -4
  97. package/dist/api/resources/models/client/Client.js +2 -2
  98. package/dist/api/resources/providers/client/Client.js +7 -7
  99. package/dist/api/resources/providers/client/requests/ListProvidersRequest.d.ts +1 -1
  100. package/dist/api/resources/runs/client/Client.d.ts +3 -2
  101. package/dist/api/resources/runs/client/Client.js +17 -13
  102. package/dist/api/resources/runs/client/requests/ListRunMessagesRequest.d.ts +7 -3
  103. package/dist/api/resources/sources/client/Client.js +6 -6
  104. package/dist/api/resources/sources/resources/files/client/Client.js +6 -6
  105. package/dist/api/resources/sources/resources/files/client/requests/FilesListRequest.d.ts +1 -1
  106. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  107. package/dist/api/resources/tag/client/Client.js +4 -4
  108. package/dist/api/resources/tag/client/requests/ListTagsRequest.d.ts +1 -1
  109. package/dist/api/resources/tools/client/Client.js +14 -14
  110. package/dist/api/resources/tools/client/requests/ToolsListRequest.d.ts +1 -1
  111. package/dist/api/types/AssistantMessage.d.ts +2 -1
  112. package/dist/api/types/AssistantMessageContent.d.ts +5 -0
  113. package/dist/api/types/AssistantMessageContent.js +5 -0
  114. package/dist/api/types/LlmConfig.d.ts +3 -0
  115. package/dist/api/types/Message.d.ts +2 -2
  116. package/dist/api/types/MessageCreate.d.ts +2 -2
  117. package/dist/api/types/MessageCreateContent.d.ts +8 -0
  118. package/dist/api/types/MessageCreateContent.js +5 -0
  119. package/dist/api/types/SystemMessage.d.ts +3 -2
  120. package/dist/api/types/SystemMessageContent.d.ts +5 -0
  121. package/dist/api/types/SystemMessageContent.js +5 -0
  122. package/dist/api/types/TextContent.d.ts +8 -0
  123. package/dist/api/types/TextContent.js +5 -0
  124. package/dist/api/types/UserMessage.d.ts +3 -2
  125. package/dist/api/types/UserMessageContent.d.ts +5 -0
  126. package/dist/api/types/UserMessageContent.js +5 -0
  127. package/dist/api/types/index.d.ts +5 -0
  128. package/dist/api/types/index.js +5 -0
  129. package/dist/serialization/resources/agents/client/index.d.ts +0 -3
  130. package/dist/serialization/resources/agents/client/index.js +1 -4
  131. package/dist/serialization/resources/agents/client/requests/index.d.ts +0 -1
  132. package/dist/serialization/resources/agents/client/requests/index.js +1 -3
  133. package/dist/serialization/resources/agents/resources/archivalMemory/client/create.d.ts +11 -0
  134. package/dist/serialization/resources/agents/{client/createArchivalMemory.js → resources/archivalMemory/client/create.js} +2 -2
  135. package/dist/serialization/resources/agents/resources/archivalMemory/client/index.d.ts +3 -0
  136. package/dist/serialization/resources/agents/resources/archivalMemory/client/index.js +42 -0
  137. package/dist/serialization/resources/agents/resources/archivalMemory/client/list.d.ts +11 -0
  138. package/dist/serialization/resources/agents/{client/listArchivalMemory.js → resources/archivalMemory/client/list.js} +2 -2
  139. package/dist/serialization/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.d.ts +12 -0
  140. package/{serialization/resources/agents → dist/serialization/resources/agents/resources/archivalMemory}/client/requests/CreateArchivalMemory.js +1 -1
  141. package/dist/serialization/resources/agents/resources/archivalMemory/client/requests/index.d.ts +1 -0
  142. package/dist/serialization/resources/agents/resources/archivalMemory/client/requests/index.js +5 -0
  143. package/dist/serialization/resources/agents/resources/archivalMemory/index.d.ts +1 -0
  144. package/dist/serialization/resources/agents/resources/archivalMemory/index.js +17 -0
  145. package/dist/serialization/resources/agents/resources/coreMemory/client/index.d.ts +1 -0
  146. package/dist/serialization/resources/agents/resources/coreMemory/client/index.js +37 -0
  147. package/dist/serialization/resources/agents/resources/coreMemory/client/listBlocks.d.ts +11 -0
  148. package/{serialization/resources/agents/client/listCoreMemoryBlocks.js → dist/serialization/resources/agents/resources/coreMemory/client/listBlocks.js} +2 -2
  149. package/dist/serialization/resources/agents/resources/coreMemory/index.d.ts +1 -0
  150. package/dist/serialization/resources/agents/resources/coreMemory/index.js +17 -0
  151. package/dist/serialization/resources/agents/resources/index.d.ts +3 -0
  152. package/dist/serialization/resources/agents/resources/index.js +4 -1
  153. package/dist/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.d.ts +2 -1
  154. package/dist/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.js +2 -1
  155. package/dist/serialization/resources/agents/resources/messages/types/MessageUpdateContent.d.ts +11 -0
  156. package/dist/serialization/resources/agents/resources/messages/types/MessageUpdateContent.js +42 -0
  157. package/dist/serialization/resources/agents/resources/messages/types/index.d.ts +1 -0
  158. package/dist/serialization/resources/agents/resources/messages/types/index.js +1 -0
  159. package/dist/serialization/resources/blocks/client/index.d.ts +1 -0
  160. package/dist/serialization/resources/blocks/client/index.js +2 -1
  161. package/dist/serialization/resources/{agents/client/createArchivalMemory.d.ts → blocks/client/listAgentsForBlock.d.ts} +3 -3
  162. package/dist/serialization/resources/blocks/client/listAgentsForBlock.js +42 -0
  163. package/dist/serialization/types/AssistantMessage.d.ts +2 -1
  164. package/dist/serialization/types/AssistantMessage.js +2 -1
  165. package/dist/serialization/types/AssistantMessageContent.d.ts +11 -0
  166. package/dist/serialization/types/AssistantMessageContent.js +42 -0
  167. package/dist/serialization/types/LlmConfig.d.ts +1 -0
  168. package/dist/serialization/types/LlmConfig.js +1 -0
  169. package/dist/serialization/types/Message.d.ts +2 -1
  170. package/dist/serialization/types/Message.js +2 -1
  171. package/dist/serialization/types/MessageCreate.d.ts +2 -1
  172. package/dist/serialization/types/MessageCreate.js +2 -1
  173. package/dist/serialization/types/MessageCreateContent.d.ts +11 -0
  174. package/dist/serialization/types/MessageCreateContent.js +42 -0
  175. package/dist/serialization/types/SystemMessage.d.ts +2 -1
  176. package/dist/serialization/types/SystemMessage.js +2 -1
  177. package/dist/serialization/types/SystemMessageContent.d.ts +11 -0
  178. package/dist/serialization/types/SystemMessageContent.js +42 -0
  179. package/dist/serialization/types/TextContent.d.ts +13 -0
  180. package/dist/serialization/types/TextContent.js +44 -0
  181. package/dist/serialization/types/UserMessage.d.ts +2 -1
  182. package/dist/serialization/types/UserMessage.js +2 -1
  183. package/dist/serialization/types/UserMessageContent.d.ts +11 -0
  184. package/dist/serialization/types/UserMessageContent.js +42 -0
  185. package/dist/serialization/types/index.d.ts +5 -0
  186. package/dist/serialization/types/index.js +5 -0
  187. package/dist/version.d.ts +1 -1
  188. package/dist/version.js +1 -1
  189. package/package.json +1 -1
  190. package/reference.md +488 -895
  191. package/serialization/resources/agents/client/index.d.ts +0 -3
  192. package/serialization/resources/agents/client/index.js +1 -4
  193. package/serialization/resources/agents/client/requests/index.d.ts +0 -1
  194. package/serialization/resources/agents/client/requests/index.js +1 -3
  195. package/serialization/resources/agents/resources/archivalMemory/client/create.d.ts +11 -0
  196. package/serialization/resources/agents/{client/listArchivalMemory.js → resources/archivalMemory/client/create.js} +2 -2
  197. package/serialization/resources/agents/resources/archivalMemory/client/index.d.ts +3 -0
  198. package/serialization/resources/agents/resources/archivalMemory/client/index.js +42 -0
  199. package/serialization/resources/agents/resources/archivalMemory/client/list.d.ts +11 -0
  200. package/serialization/resources/agents/{client/createArchivalMemory.js → resources/archivalMemory/client/list.js} +2 -2
  201. package/serialization/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.d.ts +12 -0
  202. package/{dist/serialization/resources/agents → serialization/resources/agents/resources/archivalMemory}/client/requests/CreateArchivalMemory.js +1 -1
  203. package/serialization/resources/agents/resources/archivalMemory/client/requests/index.d.ts +1 -0
  204. package/serialization/resources/agents/resources/archivalMemory/client/requests/index.js +5 -0
  205. package/serialization/resources/agents/resources/archivalMemory/index.d.ts +1 -0
  206. package/serialization/resources/agents/resources/archivalMemory/index.js +17 -0
  207. package/serialization/resources/agents/resources/coreMemory/client/index.d.ts +1 -0
  208. package/serialization/resources/agents/resources/coreMemory/client/index.js +37 -0
  209. package/serialization/resources/agents/resources/coreMemory/client/listBlocks.d.ts +11 -0
  210. package/{dist/serialization/resources/agents/client/listCoreMemoryBlocks.js → serialization/resources/agents/resources/coreMemory/client/listBlocks.js} +2 -2
  211. package/serialization/resources/agents/resources/coreMemory/index.d.ts +1 -0
  212. package/serialization/resources/agents/resources/coreMemory/index.js +17 -0
  213. package/serialization/resources/agents/resources/index.d.ts +3 -0
  214. package/serialization/resources/agents/resources/index.js +4 -1
  215. package/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.d.ts +2 -1
  216. package/serialization/resources/agents/resources/messages/client/requests/MessageUpdate.js +2 -1
  217. package/serialization/resources/agents/resources/messages/types/MessageUpdateContent.d.ts +11 -0
  218. package/serialization/resources/agents/resources/messages/types/MessageUpdateContent.js +42 -0
  219. package/serialization/resources/agents/resources/messages/types/index.d.ts +1 -0
  220. package/serialization/resources/agents/resources/messages/types/index.js +1 -0
  221. package/serialization/resources/blocks/client/index.d.ts +1 -0
  222. package/serialization/resources/blocks/client/index.js +2 -1
  223. package/{dist/serialization/resources/agents/client/listArchivalMemory.d.ts → serialization/resources/blocks/client/listAgentsForBlock.d.ts} +3 -3
  224. package/serialization/resources/blocks/client/listAgentsForBlock.js +42 -0
  225. package/serialization/types/AssistantMessage.d.ts +2 -1
  226. package/serialization/types/AssistantMessage.js +2 -1
  227. package/serialization/types/AssistantMessageContent.d.ts +11 -0
  228. package/serialization/types/AssistantMessageContent.js +42 -0
  229. package/serialization/types/LlmConfig.d.ts +1 -0
  230. package/serialization/types/LlmConfig.js +1 -0
  231. package/serialization/types/Message.d.ts +2 -1
  232. package/serialization/types/Message.js +2 -1
  233. package/serialization/types/MessageCreate.d.ts +2 -1
  234. package/serialization/types/MessageCreate.js +2 -1
  235. package/serialization/types/MessageCreateContent.d.ts +11 -0
  236. package/serialization/types/MessageCreateContent.js +42 -0
  237. package/serialization/types/SystemMessage.d.ts +2 -1
  238. package/serialization/types/SystemMessage.js +2 -1
  239. package/serialization/types/SystemMessageContent.d.ts +11 -0
  240. package/serialization/types/SystemMessageContent.js +42 -0
  241. package/serialization/types/TextContent.d.ts +13 -0
  242. package/serialization/types/TextContent.js +44 -0
  243. package/serialization/types/UserMessage.d.ts +2 -1
  244. package/serialization/types/UserMessage.js +2 -1
  245. package/serialization/types/UserMessageContent.d.ts +11 -0
  246. package/serialization/types/UserMessageContent.js +42 -0
  247. package/serialization/types/index.d.ts +5 -0
  248. package/serialization/types/index.js +5 -0
  249. package/version.d.ts +1 -1
  250. package/version.js +1 -1
  251. package/dist/serialization/resources/agents/client/listCoreMemoryBlocks.d.ts +0 -11
  252. package/dist/serialization/resources/agents/client/requests/CreateArchivalMemory.d.ts +0 -12
  253. package/serialization/resources/agents/client/createArchivalMemory.d.ts +0 -11
  254. package/serialization/resources/agents/client/listArchivalMemory.d.ts +0 -11
  255. package/serialization/resources/agents/client/listCoreMemoryBlocks.d.ts +0 -11
  256. package/serialization/resources/agents/client/requests/CreateArchivalMemory.d.ts +0 -12
  257. /package/api/resources/agents/{client/requests/CreateArchivalMemory.js → resources/archivalMemory/client/requests/ArchivalMemoryListRequest.js} +0 -0
  258. /package/api/resources/agents/{client → resources/archivalMemory/client}/requests/CreateArchivalMemory.d.ts +0 -0
  259. /package/{dist/api/resources/agents → api/resources/agents/resources/archivalMemory}/client/requests/CreateArchivalMemory.js +0 -0
  260. /package/api/resources/agents/{client/requests/ListArchivalMemoryRequest.js → resources/messages/types/MessageUpdateContent.js} +0 -0
  261. /package/{dist/api/resources/agents/client/requests/ListArchivalMemoryRequest.js → api/types/AssistantMessageContent.js} +0 -0
  262. /package/dist/api/resources/agents/{client → resources/archivalMemory/client}/requests/CreateArchivalMemory.d.ts +0 -0
@@ -58,11 +58,11 @@ const errors = __importStar(require("../../../../errors/index"));
58
58
  const Client_1 = require("../resources/context/client/Client");
59
59
  const Client_2 = require("../resources/tools/client/Client");
60
60
  const Client_3 = require("../resources/sources/client/Client");
61
- const Client_4 = require("../resources/messages/client/Client");
62
- const Client_5 = require("../resources/templates/client/Client");
63
- const Client_6 = require("../resources/memoryVariables/client/Client");
64
- const Client_7 = require("../resources/coreMemory/client/Client");
65
- const Client_8 = require("../resources/archivalMemory/client/Client");
61
+ const Client_4 = require("../resources/coreMemory/client/Client");
62
+ const Client_5 = require("../resources/archivalMemory/client/Client");
63
+ const Client_6 = require("../resources/messages/client/Client");
64
+ const Client_7 = require("../resources/templates/client/Client");
65
+ const Client_8 = require("../resources/memoryVariables/client/Client");
66
66
  class Agents {
67
67
  constructor(_options = {}) {
68
68
  this._options = _options;
@@ -79,25 +79,25 @@ class Agents {
79
79
  var _a;
80
80
  return ((_a = this._sources) !== null && _a !== void 0 ? _a : (this._sources = new Client_3.Sources(this._options)));
81
81
  }
82
- get messages() {
82
+ get coreMemory() {
83
83
  var _a;
84
- return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_4.Messages(this._options)));
84
+ return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_4.CoreMemory(this._options)));
85
85
  }
86
- get templates() {
86
+ get archivalMemory() {
87
87
  var _a;
88
- return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_5.Templates(this._options)));
88
+ return ((_a = this._archivalMemory) !== null && _a !== void 0 ? _a : (this._archivalMemory = new Client_5.ArchivalMemory(this._options)));
89
89
  }
90
- get memoryVariables() {
90
+ get messages() {
91
91
  var _a;
92
- return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_6.MemoryVariables(this._options)));
92
+ return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_6.Messages(this._options)));
93
93
  }
94
- get coreMemory() {
94
+ get templates() {
95
95
  var _a;
96
- return ((_a = this._coreMemory) !== null && _a !== void 0 ? _a : (this._coreMemory = new Client_7.CoreMemory(this._options)));
96
+ return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_7.Templates(this._options)));
97
97
  }
98
- get archivalMemory() {
98
+ get memoryVariables() {
99
99
  var _a;
100
- return ((_a = this._archivalMemory) !== null && _a !== void 0 ? _a : (this._archivalMemory = new Client_8.ArchivalMemory(this._options)));
100
+ return ((_a = this._memoryVariables) !== null && _a !== void 0 ? _a : (this._memoryVariables = new Client_8.MemoryVariables(this._options)));
101
101
  }
102
102
  /**
103
103
  * List all agents associated with a given user.
@@ -114,7 +114,7 @@ class Agents {
114
114
  list() {
115
115
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
116
116
  var _a, _b, _c;
117
- const { name, tags, matchAllTags, cursor, limit, queryText } = request;
117
+ const { name, tags, matchAllTags, before, after, limit, queryText } = request;
118
118
  const _queryParams = {};
119
119
  if (name != null) {
120
120
  _queryParams["name"] = name;
@@ -130,8 +130,11 @@ class Agents {
130
130
  if (matchAllTags != null) {
131
131
  _queryParams["match_all_tags"] = matchAllTags.toString();
132
132
  }
133
- if (cursor != null) {
134
- _queryParams["cursor"] = cursor;
133
+ if (before != null) {
134
+ _queryParams["before"] = before;
135
+ }
136
+ if (after != null) {
137
+ _queryParams["after"] = after;
135
138
  }
136
139
  if (limit != null) {
137
140
  _queryParams["limit"] = limit.toString();
@@ -142,7 +145,7 @@ class Agents {
142
145
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
143
146
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, "v1/agents/"),
144
147
  method: "GET",
145
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
148
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
146
149
  contentType: "application/json",
147
150
  queryParameters: _queryParams,
148
151
  requestType: "json",
@@ -208,7 +211,7 @@ class Agents {
208
211
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
209
212
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, "v1/agents/"),
210
213
  method: "POST",
211
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
214
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
212
215
  contentType: "application/json",
213
216
  requestType: "json",
214
217
  body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -274,7 +277,7 @@ class Agents {
274
277
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
275
278
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
276
279
  method: "GET",
277
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
280
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
278
281
  contentType: "application/json",
279
282
  requestType: "json",
280
283
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -339,7 +342,7 @@ class Agents {
339
342
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
340
343
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
341
344
  method: "DELETE",
342
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
343
346
  contentType: "application/json",
344
347
  requestType: "json",
345
348
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -399,7 +402,7 @@ class Agents {
399
402
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
400
403
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}`),
401
404
  method: "PATCH",
402
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
405
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
403
406
  contentType: "application/json",
404
407
  requestType: "json",
405
408
  body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -448,610 +451,6 @@ class Agents {
448
451
  }
449
452
  });
450
453
  }
451
- /**
452
- * Retrieve the memory state of a specific agent.
453
- * This endpoint fetches the current memory state of the agent identified by the user ID and agent ID.
454
- *
455
- * @param {string} agentId
456
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
457
- *
458
- * @throws {@link Letta.UnprocessableEntityError}
459
- *
460
- * @example
461
- * await client.agents.retrieveAgentMemory("agent_id")
462
- */
463
- retrieveAgentMemory(agentId, requestOptions) {
464
- return __awaiter(this, void 0, void 0, function* () {
465
- var _a, _b, _c;
466
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
467
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory`),
468
- method: "GET",
469
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
470
- contentType: "application/json",
471
- requestType: "json",
472
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
473
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
474
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
475
- });
476
- if (_response.ok) {
477
- return serializers.Memory.parseOrThrow(_response.body, {
478
- unrecognizedObjectKeys: "passthrough",
479
- allowUnrecognizedUnionMembers: true,
480
- allowUnrecognizedEnumValues: true,
481
- skipValidation: true,
482
- breadcrumbsPrefix: ["response"],
483
- });
484
- }
485
- if (_response.error.reason === "status-code") {
486
- switch (_response.error.statusCode) {
487
- case 422:
488
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
489
- unrecognizedObjectKeys: "passthrough",
490
- allowUnrecognizedUnionMembers: true,
491
- allowUnrecognizedEnumValues: true,
492
- skipValidation: true,
493
- breadcrumbsPrefix: ["response"],
494
- }));
495
- default:
496
- throw new errors.LettaError({
497
- statusCode: _response.error.statusCode,
498
- body: _response.error.body,
499
- });
500
- }
501
- }
502
- switch (_response.error.reason) {
503
- case "non-json":
504
- throw new errors.LettaError({
505
- statusCode: _response.error.statusCode,
506
- body: _response.error.rawBody,
507
- });
508
- case "timeout":
509
- throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory.");
510
- case "unknown":
511
- throw new errors.LettaError({
512
- message: _response.error.errorMessage,
513
- });
514
- }
515
- });
516
- }
517
- /**
518
- * Retrieve a memory block from an agent.
519
- *
520
- * @param {string} agentId
521
- * @param {string} blockLabel
522
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
523
- *
524
- * @throws {@link Letta.UnprocessableEntityError}
525
- *
526
- * @example
527
- * await client.agents.retrieveCoreMemoryBlock("agent_id", "block_label")
528
- */
529
- retrieveCoreMemoryBlock(agentId, blockLabel, requestOptions) {
530
- return __awaiter(this, void 0, void 0, function* () {
531
- var _a, _b, _c;
532
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
533
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/${encodeURIComponent(blockLabel)}`),
534
- method: "GET",
535
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
536
- contentType: "application/json",
537
- requestType: "json",
538
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
539
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
540
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
541
- });
542
- if (_response.ok) {
543
- return serializers.Block.parseOrThrow(_response.body, {
544
- unrecognizedObjectKeys: "passthrough",
545
- allowUnrecognizedUnionMembers: true,
546
- allowUnrecognizedEnumValues: true,
547
- skipValidation: true,
548
- breadcrumbsPrefix: ["response"],
549
- });
550
- }
551
- if (_response.error.reason === "status-code") {
552
- switch (_response.error.statusCode) {
553
- case 422:
554
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
555
- unrecognizedObjectKeys: "passthrough",
556
- allowUnrecognizedUnionMembers: true,
557
- allowUnrecognizedEnumValues: true,
558
- skipValidation: true,
559
- breadcrumbsPrefix: ["response"],
560
- }));
561
- default:
562
- throw new errors.LettaError({
563
- statusCode: _response.error.statusCode,
564
- body: _response.error.body,
565
- });
566
- }
567
- }
568
- switch (_response.error.reason) {
569
- case "non-json":
570
- throw new errors.LettaError({
571
- statusCode: _response.error.statusCode,
572
- body: _response.error.rawBody,
573
- });
574
- case "timeout":
575
- throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
576
- case "unknown":
577
- throw new errors.LettaError({
578
- message: _response.error.errorMessage,
579
- });
580
- }
581
- });
582
- }
583
- /**
584
- * Updates a memory block of an agent.
585
- *
586
- * @param {string} agentId
587
- * @param {string} blockLabel
588
- * @param {Letta.BlockUpdate} request
589
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
590
- *
591
- * @throws {@link Letta.UnprocessableEntityError}
592
- *
593
- * @example
594
- * await client.agents.modifyCoreMemoryBlock("agent_id", "block_label", {})
595
- */
596
- modifyCoreMemoryBlock(agentId, blockLabel, request, requestOptions) {
597
- return __awaiter(this, void 0, void 0, function* () {
598
- var _a, _b, _c;
599
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
600
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/${encodeURIComponent(blockLabel)}`),
601
- method: "PATCH",
602
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
603
- contentType: "application/json",
604
- requestType: "json",
605
- body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
606
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
607
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
608
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
609
- });
610
- if (_response.ok) {
611
- return serializers.Block.parseOrThrow(_response.body, {
612
- unrecognizedObjectKeys: "passthrough",
613
- allowUnrecognizedUnionMembers: true,
614
- allowUnrecognizedEnumValues: true,
615
- skipValidation: true,
616
- breadcrumbsPrefix: ["response"],
617
- });
618
- }
619
- if (_response.error.reason === "status-code") {
620
- switch (_response.error.statusCode) {
621
- case 422:
622
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
623
- unrecognizedObjectKeys: "passthrough",
624
- allowUnrecognizedUnionMembers: true,
625
- allowUnrecognizedEnumValues: true,
626
- skipValidation: true,
627
- breadcrumbsPrefix: ["response"],
628
- }));
629
- default:
630
- throw new errors.LettaError({
631
- statusCode: _response.error.statusCode,
632
- body: _response.error.body,
633
- });
634
- }
635
- }
636
- switch (_response.error.reason) {
637
- case "non-json":
638
- throw new errors.LettaError({
639
- statusCode: _response.error.statusCode,
640
- body: _response.error.rawBody,
641
- });
642
- case "timeout":
643
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
644
- case "unknown":
645
- throw new errors.LettaError({
646
- message: _response.error.errorMessage,
647
- });
648
- }
649
- });
650
- }
651
- /**
652
- * Retrieve the memory blocks of a specific agent.
653
- *
654
- * @param {string} agentId
655
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
656
- *
657
- * @throws {@link Letta.UnprocessableEntityError}
658
- *
659
- * @example
660
- * await client.agents.listCoreMemoryBlocks("agent_id")
661
- */
662
- listCoreMemoryBlocks(agentId, requestOptions) {
663
- return __awaiter(this, void 0, void 0, function* () {
664
- var _a, _b, _c;
665
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
666
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks`),
667
- method: "GET",
668
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
669
- contentType: "application/json",
670
- requestType: "json",
671
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
672
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
673
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
674
- });
675
- if (_response.ok) {
676
- return serializers.agents.listCoreMemoryBlocks.Response.parseOrThrow(_response.body, {
677
- unrecognizedObjectKeys: "passthrough",
678
- allowUnrecognizedUnionMembers: true,
679
- allowUnrecognizedEnumValues: true,
680
- skipValidation: true,
681
- breadcrumbsPrefix: ["response"],
682
- });
683
- }
684
- if (_response.error.reason === "status-code") {
685
- switch (_response.error.statusCode) {
686
- case 422:
687
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
688
- unrecognizedObjectKeys: "passthrough",
689
- allowUnrecognizedUnionMembers: true,
690
- allowUnrecognizedEnumValues: true,
691
- skipValidation: true,
692
- breadcrumbsPrefix: ["response"],
693
- }));
694
- default:
695
- throw new errors.LettaError({
696
- statusCode: _response.error.statusCode,
697
- body: _response.error.body,
698
- });
699
- }
700
- }
701
- switch (_response.error.reason) {
702
- case "non-json":
703
- throw new errors.LettaError({
704
- statusCode: _response.error.statusCode,
705
- body: _response.error.rawBody,
706
- });
707
- case "timeout":
708
- throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks.");
709
- case "unknown":
710
- throw new errors.LettaError({
711
- message: _response.error.errorMessage,
712
- });
713
- }
714
- });
715
- }
716
- /**
717
- * Attach a block to an agent.
718
- *
719
- * @param {string} agentId
720
- * @param {string} blockId
721
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
722
- *
723
- * @throws {@link Letta.UnprocessableEntityError}
724
- *
725
- * @example
726
- * await client.agents.attachCoreMemoryBlock("agent_id", "block_id")
727
- */
728
- attachCoreMemoryBlock(agentId, blockId, requestOptions) {
729
- return __awaiter(this, void 0, void 0, function* () {
730
- var _a, _b, _c;
731
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
732
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/attach/${encodeURIComponent(blockId)}`),
733
- method: "PATCH",
734
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
735
- contentType: "application/json",
736
- requestType: "json",
737
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
738
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
739
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
740
- });
741
- if (_response.ok) {
742
- return serializers.AgentState.parseOrThrow(_response.body, {
743
- unrecognizedObjectKeys: "passthrough",
744
- allowUnrecognizedUnionMembers: true,
745
- allowUnrecognizedEnumValues: true,
746
- skipValidation: true,
747
- breadcrumbsPrefix: ["response"],
748
- });
749
- }
750
- if (_response.error.reason === "status-code") {
751
- switch (_response.error.statusCode) {
752
- case 422:
753
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
754
- unrecognizedObjectKeys: "passthrough",
755
- allowUnrecognizedUnionMembers: true,
756
- allowUnrecognizedEnumValues: true,
757
- skipValidation: true,
758
- breadcrumbsPrefix: ["response"],
759
- }));
760
- default:
761
- throw new errors.LettaError({
762
- statusCode: _response.error.statusCode,
763
- body: _response.error.body,
764
- });
765
- }
766
- }
767
- switch (_response.error.reason) {
768
- case "non-json":
769
- throw new errors.LettaError({
770
- statusCode: _response.error.statusCode,
771
- body: _response.error.rawBody,
772
- });
773
- case "timeout":
774
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/attach/{block_id}.");
775
- case "unknown":
776
- throw new errors.LettaError({
777
- message: _response.error.errorMessage,
778
- });
779
- }
780
- });
781
- }
782
- /**
783
- * Detach a block from an agent.
784
- *
785
- * @param {string} agentId
786
- * @param {string} blockId
787
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
788
- *
789
- * @throws {@link Letta.UnprocessableEntityError}
790
- *
791
- * @example
792
- * await client.agents.detachCoreMemoryBlock("agent_id", "block_id")
793
- */
794
- detachCoreMemoryBlock(agentId, blockId, requestOptions) {
795
- return __awaiter(this, void 0, void 0, function* () {
796
- var _a, _b, _c;
797
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
798
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/core-memory/blocks/detach/${encodeURIComponent(blockId)}`),
799
- method: "PATCH",
800
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
801
- contentType: "application/json",
802
- requestType: "json",
803
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
804
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
805
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
806
- });
807
- if (_response.ok) {
808
- return serializers.AgentState.parseOrThrow(_response.body, {
809
- unrecognizedObjectKeys: "passthrough",
810
- allowUnrecognizedUnionMembers: true,
811
- allowUnrecognizedEnumValues: true,
812
- skipValidation: true,
813
- breadcrumbsPrefix: ["response"],
814
- });
815
- }
816
- if (_response.error.reason === "status-code") {
817
- switch (_response.error.statusCode) {
818
- case 422:
819
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
820
- unrecognizedObjectKeys: "passthrough",
821
- allowUnrecognizedUnionMembers: true,
822
- allowUnrecognizedEnumValues: true,
823
- skipValidation: true,
824
- breadcrumbsPrefix: ["response"],
825
- }));
826
- default:
827
- throw new errors.LettaError({
828
- statusCode: _response.error.statusCode,
829
- body: _response.error.body,
830
- });
831
- }
832
- }
833
- switch (_response.error.reason) {
834
- case "non-json":
835
- throw new errors.LettaError({
836
- statusCode: _response.error.statusCode,
837
- body: _response.error.rawBody,
838
- });
839
- case "timeout":
840
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/detach/{block_id}.");
841
- case "unknown":
842
- throw new errors.LettaError({
843
- message: _response.error.errorMessage,
844
- });
845
- }
846
- });
847
- }
848
- /**
849
- * Retrieve the memories in an agent's archival memory store (paginated query).
850
- *
851
- * @param {string} agentId
852
- * @param {Letta.ListArchivalMemoryRequest} request
853
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
854
- *
855
- * @throws {@link Letta.UnprocessableEntityError}
856
- *
857
- * @example
858
- * await client.agents.listArchivalMemory("agent_id")
859
- */
860
- listArchivalMemory(agentId_1) {
861
- return __awaiter(this, arguments, void 0, function* (agentId, request = {}, requestOptions) {
862
- var _a, _b, _c;
863
- const { after, before, limit } = request;
864
- const _queryParams = {};
865
- if (after != null) {
866
- _queryParams["after"] = after.toString();
867
- }
868
- if (before != null) {
869
- _queryParams["before"] = before.toString();
870
- }
871
- if (limit != null) {
872
- _queryParams["limit"] = limit.toString();
873
- }
874
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
875
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival-memory`),
876
- method: "GET",
877
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
878
- contentType: "application/json",
879
- queryParameters: _queryParams,
880
- requestType: "json",
881
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
882
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
883
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
884
- });
885
- if (_response.ok) {
886
- return serializers.agents.listArchivalMemory.Response.parseOrThrow(_response.body, {
887
- unrecognizedObjectKeys: "passthrough",
888
- allowUnrecognizedUnionMembers: true,
889
- allowUnrecognizedEnumValues: true,
890
- skipValidation: true,
891
- breadcrumbsPrefix: ["response"],
892
- });
893
- }
894
- if (_response.error.reason === "status-code") {
895
- switch (_response.error.statusCode) {
896
- case 422:
897
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
898
- unrecognizedObjectKeys: "passthrough",
899
- allowUnrecognizedUnionMembers: true,
900
- allowUnrecognizedEnumValues: true,
901
- skipValidation: true,
902
- breadcrumbsPrefix: ["response"],
903
- }));
904
- default:
905
- throw new errors.LettaError({
906
- statusCode: _response.error.statusCode,
907
- body: _response.error.body,
908
- });
909
- }
910
- }
911
- switch (_response.error.reason) {
912
- case "non-json":
913
- throw new errors.LettaError({
914
- statusCode: _response.error.statusCode,
915
- body: _response.error.rawBody,
916
- });
917
- case "timeout":
918
- throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/archival-memory.");
919
- case "unknown":
920
- throw new errors.LettaError({
921
- message: _response.error.errorMessage,
922
- });
923
- }
924
- });
925
- }
926
- /**
927
- * Insert a memory into an agent's archival memory store.
928
- *
929
- * @param {string} agentId
930
- * @param {Letta.CreateArchivalMemory} request
931
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
932
- *
933
- * @throws {@link Letta.UnprocessableEntityError}
934
- *
935
- * @example
936
- * await client.agents.createArchivalMemory("agent_id", {
937
- * text: "text"
938
- * })
939
- */
940
- createArchivalMemory(agentId, request, requestOptions) {
941
- return __awaiter(this, void 0, void 0, function* () {
942
- var _a, _b, _c;
943
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
944
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival-memory`),
945
- method: "POST",
946
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
947
- contentType: "application/json",
948
- requestType: "json",
949
- body: serializers.CreateArchivalMemory.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
950
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
951
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
952
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
953
- });
954
- if (_response.ok) {
955
- return serializers.agents.createArchivalMemory.Response.parseOrThrow(_response.body, {
956
- unrecognizedObjectKeys: "passthrough",
957
- allowUnrecognizedUnionMembers: true,
958
- allowUnrecognizedEnumValues: true,
959
- skipValidation: true,
960
- breadcrumbsPrefix: ["response"],
961
- });
962
- }
963
- if (_response.error.reason === "status-code") {
964
- switch (_response.error.statusCode) {
965
- case 422:
966
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
967
- unrecognizedObjectKeys: "passthrough",
968
- allowUnrecognizedUnionMembers: true,
969
- allowUnrecognizedEnumValues: true,
970
- skipValidation: true,
971
- breadcrumbsPrefix: ["response"],
972
- }));
973
- default:
974
- throw new errors.LettaError({
975
- statusCode: _response.error.statusCode,
976
- body: _response.error.body,
977
- });
978
- }
979
- }
980
- switch (_response.error.reason) {
981
- case "non-json":
982
- throw new errors.LettaError({
983
- statusCode: _response.error.statusCode,
984
- body: _response.error.rawBody,
985
- });
986
- case "timeout":
987
- throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/archival-memory.");
988
- case "unknown":
989
- throw new errors.LettaError({
990
- message: _response.error.errorMessage,
991
- });
992
- }
993
- });
994
- }
995
- /**
996
- * Delete a memory from an agent's archival memory store.
997
- *
998
- * @param {string} agentId
999
- * @param {string} memoryId
1000
- * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
1001
- *
1002
- * @throws {@link Letta.UnprocessableEntityError}
1003
- *
1004
- * @example
1005
- * await client.agents.deleteArchivalMemory("agent_id", "memory_id")
1006
- */
1007
- deleteArchivalMemory(agentId, memoryId, requestOptions) {
1008
- return __awaiter(this, void 0, void 0, function* () {
1009
- var _a, _b, _c;
1010
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
1011
- url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/archival-memory/${encodeURIComponent(memoryId)}`),
1012
- method: "DELETE",
1013
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
1014
- contentType: "application/json",
1015
- requestType: "json",
1016
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1017
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1018
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1019
- });
1020
- if (_response.ok) {
1021
- return _response.body;
1022
- }
1023
- if (_response.error.reason === "status-code") {
1024
- switch (_response.error.statusCode) {
1025
- case 422:
1026
- throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
1027
- unrecognizedObjectKeys: "passthrough",
1028
- allowUnrecognizedUnionMembers: true,
1029
- allowUnrecognizedEnumValues: true,
1030
- skipValidation: true,
1031
- breadcrumbsPrefix: ["response"],
1032
- }));
1033
- default:
1034
- throw new errors.LettaError({
1035
- statusCode: _response.error.statusCode,
1036
- body: _response.error.body,
1037
- });
1038
- }
1039
- }
1040
- switch (_response.error.reason) {
1041
- case "non-json":
1042
- throw new errors.LettaError({
1043
- statusCode: _response.error.statusCode,
1044
- body: _response.error.rawBody,
1045
- });
1046
- case "timeout":
1047
- throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{agent_id}/archival-memory/{memory_id}.");
1048
- case "unknown":
1049
- throw new errors.LettaError({
1050
- message: _response.error.errorMessage,
1051
- });
1052
- }
1053
- });
1054
- }
1055
454
  /**
1056
455
  * Resets the messages for an agent
1057
456
  *
@@ -1075,7 +474,7 @@ class Agents {
1075
474
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
1076
475
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/reset-messages`),
1077
476
  method: "PATCH",
1078
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
477
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
1079
478
  contentType: "application/json",
1080
479
  queryParameters: _queryParams,
1081
480
  requestType: "json",
@@ -1141,7 +540,7 @@ class Agents {
1141
540
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
1142
541
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, "v1/agents/search"),
1143
542
  method: "POST",
1144
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.13", "User-Agent": "@letta-ai/letta-client/0.1.13", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
543
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.15", "User-Agent": "@letta-ai/letta-client/0.1.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
1145
544
  contentType: "application/json",
1146
545
  requestType: "json",
1147
546
  body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),