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