@letta-ai/letta-client 0.1.47 → 0.1.49

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 (180) hide show
  1. package/api/resources/agents/client/Client.d.ts +27 -0
  2. package/api/resources/agents/client/Client.js +142 -8
  3. package/api/resources/agents/client/requests/BodyUploadAgentSerialized.d.ts +13 -0
  4. package/api/resources/agents/client/requests/BodyUploadAgentSerialized.js +5 -0
  5. package/api/resources/agents/client/requests/index.d.ts +1 -0
  6. package/api/resources/agents/resources/blocks/client/Client.js +5 -5
  7. package/api/resources/agents/resources/context/client/Client.js +1 -1
  8. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  9. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  10. package/api/resources/agents/resources/messages/client/Client.js +5 -5
  11. package/api/resources/agents/resources/passages/client/Client.js +3 -3
  12. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  13. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  14. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  15. package/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItem.d.ts +1 -0
  16. package/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.d.ts +5 -0
  17. package/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.js +5 -0
  18. package/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +4 -0
  19. package/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.js +5 -0
  20. package/api/resources/agents/types/index.d.ts +2 -0
  21. package/api/resources/agents/types/index.js +2 -0
  22. package/api/resources/blocks/client/Client.js +6 -6
  23. package/api/resources/health/client/Client.js +1 -1
  24. package/api/resources/identities/client/Client.js +6 -6
  25. package/api/resources/jobs/client/Client.js +4 -4
  26. package/api/resources/models/client/Client.js +2 -2
  27. package/api/resources/providers/client/Client.js +4 -4
  28. package/api/resources/runs/client/Client.d.ts +23 -0
  29. package/api/resources/runs/client/Client.js +97 -6
  30. package/api/resources/runs/client/requests/ListRunStepsRequest.d.ts +25 -0
  31. package/api/resources/runs/client/requests/ListRunStepsRequest.js +5 -0
  32. package/api/resources/runs/client/requests/index.d.ts +1 -0
  33. package/api/resources/sources/client/Client.js +6 -6
  34. package/api/resources/sources/resources/files/client/Client.js +3 -3
  35. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  36. package/api/resources/steps/client/Client.js +2 -2
  37. package/api/resources/tag/client/Client.js +1 -1
  38. package/api/resources/templates/client/Client.js +1 -1
  39. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItem.d.ts +1 -0
  40. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.d.ts +5 -0
  41. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.js +5 -0
  42. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +4 -0
  43. package/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.js +5 -0
  44. package/api/resources/templates/types/index.d.ts +2 -0
  45. package/api/resources/templates/types/index.js +2 -0
  46. package/api/resources/tools/client/Client.js +11 -11
  47. package/api/resources/tools/client/requests/ToolRunFromSource.d.ts +2 -0
  48. package/api/resources/tools/client/requests/ToolUpdate.d.ts +2 -0
  49. package/api/resources/voice/client/Client.js +1 -1
  50. package/api/types/CompletionCreateParamsNonStreamingModel.d.ts +1 -1
  51. package/api/types/CompletionCreateParamsStreamingModel.d.ts +1 -1
  52. package/api/types/Tool.d.ts +2 -0
  53. package/api/types/ToolCreate.d.ts +2 -0
  54. package/core/index.d.ts +1 -1
  55. package/core/index.js +1 -1
  56. package/dist/api/resources/agents/client/Client.d.ts +27 -0
  57. package/dist/api/resources/agents/client/Client.js +142 -8
  58. package/dist/api/resources/agents/client/requests/BodyUploadAgentSerialized.d.ts +13 -0
  59. package/dist/api/resources/agents/client/requests/BodyUploadAgentSerialized.js +5 -0
  60. package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
  61. package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
  62. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  63. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  64. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  65. package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
  66. package/dist/api/resources/agents/resources/passages/client/Client.js +3 -3
  67. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  68. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  69. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  70. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItem.d.ts +1 -0
  71. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.d.ts +5 -0
  72. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.js +5 -0
  73. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +4 -0
  74. package/dist/api/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.js +5 -0
  75. package/dist/api/resources/agents/types/index.d.ts +2 -0
  76. package/dist/api/resources/agents/types/index.js +2 -0
  77. package/dist/api/resources/blocks/client/Client.js +6 -6
  78. package/dist/api/resources/health/client/Client.js +1 -1
  79. package/dist/api/resources/identities/client/Client.js +6 -6
  80. package/dist/api/resources/jobs/client/Client.js +4 -4
  81. package/dist/api/resources/models/client/Client.js +2 -2
  82. package/dist/api/resources/providers/client/Client.js +4 -4
  83. package/dist/api/resources/runs/client/Client.d.ts +23 -0
  84. package/dist/api/resources/runs/client/Client.js +97 -6
  85. package/dist/api/resources/runs/client/requests/ListRunStepsRequest.d.ts +25 -0
  86. package/dist/api/resources/runs/client/requests/ListRunStepsRequest.js +5 -0
  87. package/dist/api/resources/runs/client/requests/index.d.ts +1 -0
  88. package/dist/api/resources/sources/client/Client.js +6 -6
  89. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  90. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  91. package/dist/api/resources/steps/client/Client.js +2 -2
  92. package/dist/api/resources/tag/client/Client.js +1 -1
  93. package/dist/api/resources/templates/client/Client.js +1 -1
  94. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItem.d.ts +1 -0
  95. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.d.ts +5 -0
  96. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.js +5 -0
  97. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +4 -0
  98. package/dist/api/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.js +5 -0
  99. package/dist/api/resources/templates/types/index.d.ts +2 -0
  100. package/dist/api/resources/templates/types/index.js +2 -0
  101. package/dist/api/resources/tools/client/Client.js +11 -11
  102. package/dist/api/resources/tools/client/requests/ToolRunFromSource.d.ts +2 -0
  103. package/dist/api/resources/tools/client/requests/ToolUpdate.d.ts +2 -0
  104. package/dist/api/resources/voice/client/Client.js +1 -1
  105. package/dist/api/types/CompletionCreateParamsNonStreamingModel.d.ts +1 -1
  106. package/dist/api/types/CompletionCreateParamsStreamingModel.d.ts +1 -1
  107. package/dist/api/types/Tool.d.ts +2 -0
  108. package/dist/api/types/ToolCreate.d.ts +2 -0
  109. package/dist/core/index.d.ts +1 -1
  110. package/dist/core/index.js +1 -1
  111. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItem.d.ts +2 -0
  112. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItem.js +2 -0
  113. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.d.ts +11 -0
  114. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.js +46 -0
  115. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +10 -0
  116. package/dist/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.js +41 -0
  117. package/dist/serialization/resources/agents/types/index.d.ts +2 -0
  118. package/dist/serialization/resources/agents/types/index.js +2 -0
  119. package/dist/serialization/resources/runs/client/index.d.ts +1 -0
  120. package/dist/serialization/resources/runs/client/index.js +2 -1
  121. package/dist/serialization/resources/runs/client/listRunSteps.d.ts +11 -0
  122. package/dist/serialization/resources/runs/client/listRunSteps.js +42 -0
  123. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItem.d.ts +2 -0
  124. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItem.js +2 -0
  125. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.d.ts +11 -0
  126. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.js +46 -0
  127. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +10 -0
  128. package/dist/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.js +41 -0
  129. package/dist/serialization/resources/templates/types/index.d.ts +2 -0
  130. package/dist/serialization/resources/templates/types/index.js +2 -0
  131. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.d.ts +1 -0
  132. package/dist/serialization/resources/tools/client/requests/ToolRunFromSource.js +1 -0
  133. package/dist/serialization/resources/tools/client/requests/ToolUpdate.d.ts +1 -0
  134. package/dist/serialization/resources/tools/client/requests/ToolUpdate.js +1 -0
  135. package/dist/serialization/types/CompletionCreateParamsNonStreamingModel.d.ts +1 -1
  136. package/dist/serialization/types/CompletionCreateParamsNonStreamingModel.js +2 -0
  137. package/dist/serialization/types/CompletionCreateParamsStreamingModel.d.ts +1 -1
  138. package/dist/serialization/types/CompletionCreateParamsStreamingModel.js +2 -0
  139. package/dist/serialization/types/Tool.d.ts +1 -0
  140. package/dist/serialization/types/Tool.js +1 -0
  141. package/dist/serialization/types/ToolCreate.d.ts +1 -0
  142. package/dist/serialization/types/ToolCreate.js +1 -0
  143. package/dist/version.d.ts +1 -1
  144. package/dist/version.js +1 -1
  145. package/package.json +1 -1
  146. package/reference.md +215 -0
  147. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItem.d.ts +2 -0
  148. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItem.js +2 -0
  149. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.d.ts +11 -0
  150. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema.js +46 -0
  151. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +10 -0
  152. package/serialization/resources/agents/types/AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem.js +41 -0
  153. package/serialization/resources/agents/types/index.d.ts +2 -0
  154. package/serialization/resources/agents/types/index.js +2 -0
  155. package/serialization/resources/runs/client/index.d.ts +1 -0
  156. package/serialization/resources/runs/client/index.js +2 -1
  157. package/serialization/resources/runs/client/listRunSteps.d.ts +11 -0
  158. package/serialization/resources/runs/client/listRunSteps.js +42 -0
  159. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItem.d.ts +2 -0
  160. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItem.js +2 -0
  161. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.d.ts +11 -0
  162. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema.js +46 -0
  163. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.d.ts +10 -0
  164. package/serialization/resources/templates/types/TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem.js +41 -0
  165. package/serialization/resources/templates/types/index.d.ts +2 -0
  166. package/serialization/resources/templates/types/index.js +2 -0
  167. package/serialization/resources/tools/client/requests/ToolRunFromSource.d.ts +1 -0
  168. package/serialization/resources/tools/client/requests/ToolRunFromSource.js +1 -0
  169. package/serialization/resources/tools/client/requests/ToolUpdate.d.ts +1 -0
  170. package/serialization/resources/tools/client/requests/ToolUpdate.js +1 -0
  171. package/serialization/types/CompletionCreateParamsNonStreamingModel.d.ts +1 -1
  172. package/serialization/types/CompletionCreateParamsNonStreamingModel.js +2 -0
  173. package/serialization/types/CompletionCreateParamsStreamingModel.d.ts +1 -1
  174. package/serialization/types/CompletionCreateParamsStreamingModel.js +2 -0
  175. package/serialization/types/Tool.d.ts +1 -0
  176. package/serialization/types/Tool.js +1 -0
  177. package/serialization/types/ToolCreate.d.ts +1 -0
  178. package/serialization/types/ToolCreate.js +1 -0
  179. package/version.d.ts +1 -1
  180. package/version.js +1 -1
@@ -181,7 +181,7 @@ class Agents {
181
181
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
182
182
  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/"),
183
183
  method: "GET",
184
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
184
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
185
185
  contentType: "application/json",
186
186
  queryParameters: _queryParams,
187
187
  requestType: "json",
@@ -248,7 +248,7 @@ class Agents {
248
248
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
249
249
  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/"),
250
250
  method: "POST",
251
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "X-Project": project != null ? project : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
251
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, "X-Project": project != null ? project : undefined }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
252
252
  contentType: "application/json",
253
253
  requestType: "json",
254
254
  body: serializers.CreateAgentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
@@ -297,6 +297,140 @@ class Agents {
297
297
  }
298
298
  });
299
299
  }
300
+ /**
301
+ * Download the serialized JSON representation of an agent.
302
+ *
303
+ * @param {string} agentId
304
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
305
+ *
306
+ * @throws {@link Letta.UnprocessableEntityError}
307
+ *
308
+ * @example
309
+ * await client.agents.downloadAgentSerialized("agent_id")
310
+ */
311
+ downloadAgentSerialized(agentId, requestOptions) {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
+ var _a, _b, _c;
314
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
315
+ 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)}/download`),
316
+ method: "GET",
317
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
318
+ contentType: "application/json",
319
+ requestType: "json",
320
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
321
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
322
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
323
+ });
324
+ if (_response.ok) {
325
+ return _response.body;
326
+ }
327
+ if (_response.error.reason === "status-code") {
328
+ switch (_response.error.statusCode) {
329
+ case 422:
330
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
331
+ unrecognizedObjectKeys: "passthrough",
332
+ allowUnrecognizedUnionMembers: true,
333
+ allowUnrecognizedEnumValues: true,
334
+ skipValidation: true,
335
+ breadcrumbsPrefix: ["response"],
336
+ }));
337
+ default:
338
+ throw new errors.LettaError({
339
+ statusCode: _response.error.statusCode,
340
+ body: _response.error.body,
341
+ });
342
+ }
343
+ }
344
+ switch (_response.error.reason) {
345
+ case "non-json":
346
+ throw new errors.LettaError({
347
+ statusCode: _response.error.statusCode,
348
+ body: _response.error.rawBody,
349
+ });
350
+ case "timeout":
351
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/download.");
352
+ case "unknown":
353
+ throw new errors.LettaError({
354
+ message: _response.error.errorMessage,
355
+ });
356
+ }
357
+ });
358
+ }
359
+ /**
360
+ * Upload a serialized agent JSON file and recreate the agent in the system.
361
+ *
362
+ * @param {File | fs.ReadStream | Blob} file
363
+ * @param {Letta.BodyUploadAgentSerialized} request
364
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
365
+ *
366
+ * @throws {@link Letta.UnprocessableEntityError}
367
+ *
368
+ * @example
369
+ * await client.agents.uploadAgentSerialized(fs.createReadStream("/path/to/your/file"), {})
370
+ */
371
+ uploadAgentSerialized(file, request, requestOptions) {
372
+ return __awaiter(this, void 0, void 0, function* () {
373
+ var _a, _b, _c;
374
+ const _queryParams = {};
375
+ if (request.markAsCopy != null) {
376
+ _queryParams["mark_as_copy"] = request.markAsCopy.toString();
377
+ }
378
+ const _request = yield core.newFormData();
379
+ yield _request.appendFile("file", file);
380
+ const _maybeEncodedRequest = yield _request.getRequest();
381
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
382
+ 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/upload"),
383
+ method: "POST",
384
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
385
+ queryParameters: _queryParams,
386
+ requestType: "file",
387
+ duplex: _maybeEncodedRequest.duplex,
388
+ body: _maybeEncodedRequest.body,
389
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
390
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
391
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
392
+ });
393
+ if (_response.ok) {
394
+ return serializers.AgentState.parseOrThrow(_response.body, {
395
+ unrecognizedObjectKeys: "passthrough",
396
+ allowUnrecognizedUnionMembers: true,
397
+ allowUnrecognizedEnumValues: true,
398
+ skipValidation: true,
399
+ breadcrumbsPrefix: ["response"],
400
+ });
401
+ }
402
+ if (_response.error.reason === "status-code") {
403
+ switch (_response.error.statusCode) {
404
+ case 422:
405
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
406
+ unrecognizedObjectKeys: "passthrough",
407
+ allowUnrecognizedUnionMembers: true,
408
+ allowUnrecognizedEnumValues: true,
409
+ skipValidation: true,
410
+ breadcrumbsPrefix: ["response"],
411
+ }));
412
+ default:
413
+ throw new errors.LettaError({
414
+ statusCode: _response.error.statusCode,
415
+ body: _response.error.body,
416
+ });
417
+ }
418
+ }
419
+ switch (_response.error.reason) {
420
+ case "non-json":
421
+ throw new errors.LettaError({
422
+ statusCode: _response.error.statusCode,
423
+ body: _response.error.rawBody,
424
+ });
425
+ case "timeout":
426
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/upload.");
427
+ case "unknown":
428
+ throw new errors.LettaError({
429
+ message: _response.error.errorMessage,
430
+ });
431
+ }
432
+ });
433
+ }
300
434
  /**
301
435
  * Get the state of the agent.
302
436
  *
@@ -314,7 +448,7 @@ class Agents {
314
448
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
315
449
  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)}`),
316
450
  method: "GET",
317
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
451
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
318
452
  contentType: "application/json",
319
453
  requestType: "json",
320
454
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -379,7 +513,7 @@ class Agents {
379
513
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
380
514
  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)}`),
381
515
  method: "DELETE",
382
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
516
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
383
517
  contentType: "application/json",
384
518
  requestType: "json",
385
519
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -439,7 +573,7 @@ class Agents {
439
573
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
440
574
  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)}`),
441
575
  method: "PATCH",
442
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
576
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
443
577
  contentType: "application/json",
444
578
  requestType: "json",
445
579
  body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -509,7 +643,7 @@ class Agents {
509
643
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
510
644
  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)}`),
511
645
  method: "PATCH",
512
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
646
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
513
647
  contentType: "application/json",
514
648
  requestType: "json",
515
649
  body: serializers.PassageUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -581,7 +715,7 @@ class Agents {
581
715
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
582
716
  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`),
583
717
  method: "PATCH",
584
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
718
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
585
719
  contentType: "application/json",
586
720
  queryParameters: _queryParams,
587
721
  requestType: "json",
@@ -647,7 +781,7 @@ class Agents {
647
781
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
648
782
  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"),
649
783
  method: "POST",
650
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
784
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
651
785
  contentType: "application/json",
652
786
  requestType: "json",
653
787
  body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface BodyUploadAgentSerialized {
9
+ /**
10
+ * Whether to mark the uploaded agent as a copy
11
+ */
12
+ markAsCopy?: boolean;
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export { type AgentsListRequest } from "./AgentsListRequest";
2
2
  export { type CreateAgentRequest } from "./CreateAgentRequest";
3
+ export { type BodyUploadAgentSerialized } from "./BodyUploadAgentSerialized";
3
4
  export { type UpdateAgent } from "./UpdateAgent";
4
5
  export { type PassageUpdate } from "./PassageUpdate";
5
6
  export { type ResetMessagesRequest } from "./ResetMessagesRequest";
@@ -77,7 +77,7 @@ class Blocks {
77
77
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
78
78
  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)}`),
79
79
  method: "GET",
80
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
80
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
81
81
  contentType: "application/json",
82
82
  requestType: "json",
83
83
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -144,7 +144,7 @@ class Blocks {
144
144
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
145
145
  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)}`),
146
146
  method: "PATCH",
147
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
147
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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
148
  contentType: "application/json",
149
149
  requestType: "json",
150
150
  body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -210,7 +210,7 @@ class Blocks {
210
210
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
211
211
  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`),
212
212
  method: "GET",
213
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
213
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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
214
  contentType: "application/json",
215
215
  requestType: "json",
216
216
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -276,7 +276,7 @@ class Blocks {
276
276
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
277
277
  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)}`),
278
278
  method: "PATCH",
279
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
279
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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
280
  contentType: "application/json",
281
281
  requestType: "json",
282
282
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -342,7 +342,7 @@ class Blocks {
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)}/core-memory/blocks/detach/${encodeURIComponent(blockId)}`),
344
344
  method: "PATCH",
345
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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,
@@ -76,7 +76,7 @@ class Context {
76
76
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
77
  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)}/context`),
78
78
  method: "GET",
79
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
79
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
80
80
  contentType: "application/json",
81
81
  requestType: "json",
82
82
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -77,7 +77,7 @@ class CoreMemory {
77
77
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
78
78
  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`),
79
79
  method: "GET",
80
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
80
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
81
81
  contentType: "application/json",
82
82
  requestType: "json",
83
83
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -78,7 +78,7 @@ class MemoryVariables {
78
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
79
  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/variables`),
80
80
  method: "GET",
81
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
81
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
82
82
  contentType: "application/json",
83
83
  requestType: "json",
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -97,7 +97,7 @@ class Messages {
97
97
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
98
98
  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)}/messages`),
99
99
  method: "GET",
100
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
100
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
101
101
  contentType: "application/json",
102
102
  queryParameters: _queryParams,
103
103
  requestType: "json",
@@ -170,7 +170,7 @@ class Messages {
170
170
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
171
171
  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)}/messages`),
172
172
  method: "POST",
173
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
173
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
174
174
  contentType: "application/json",
175
175
  requestType: "json",
176
176
  body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -238,7 +238,7 @@ class Messages {
238
238
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
239
239
  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)}/messages/${encodeURIComponent(messageId)}`),
240
240
  method: "PATCH",
241
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
241
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
242
242
  contentType: "application/json",
243
243
  requestType: "json",
244
244
  body: serializers.agents.MessageUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -298,7 +298,7 @@ class Messages {
298
298
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
299
299
  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)}/messages/stream`),
300
300
  method: "POST",
301
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
301
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
302
302
  contentType: "application/json",
303
303
  requestType: "json",
304
304
  body: serializers.agents.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -382,7 +382,7 @@ class Messages {
382
382
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
383
383
  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)}/messages/async`),
384
384
  method: "POST",
385
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
385
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
386
386
  contentType: "application/json",
387
387
  requestType: "json",
388
388
  body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -88,7 +88,7 @@ class Passages {
88
88
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
89
89
  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`),
90
90
  method: "GET",
91
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
91
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
92
92
  contentType: "application/json",
93
93
  queryParameters: _queryParams,
94
94
  requestType: "json",
@@ -157,7 +157,7 @@ class Passages {
157
157
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
158
158
  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`),
159
159
  method: "POST",
160
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
160
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
161
161
  contentType: "application/json",
162
162
  requestType: "json",
163
163
  body: serializers.agents.CreateArchivalMemory.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -224,7 +224,7 @@ class Passages {
224
224
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
225
225
  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)}`),
226
226
  method: "DELETE",
227
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
227
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
228
228
  contentType: "application/json",
229
229
  requestType: "json",
230
230
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -77,7 +77,7 @@ class Sources {
77
77
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
78
78
  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)}/sources/attach/${encodeURIComponent(sourceId)}`),
79
79
  method: "PATCH",
80
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
80
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
81
81
  contentType: "application/json",
82
82
  requestType: "json",
83
83
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -143,7 +143,7 @@ class Sources {
143
143
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
144
144
  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)}/sources/detach/${encodeURIComponent(sourceId)}`),
145
145
  method: "PATCH",
146
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
147
147
  contentType: "application/json",
148
148
  requestType: "json",
149
149
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -208,7 +208,7 @@ class Sources {
208
208
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
209
209
  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)}/sources`),
210
210
  method: "GET",
211
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
211
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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
212
  contentType: "application/json",
213
213
  requestType: "json",
214
214
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -96,7 +96,7 @@ class Templates {
96
96
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
97
97
  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)}/version-template`),
98
98
  method: "POST",
99
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
99
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
100
100
  contentType: "application/json",
101
101
  queryParameters: _queryParams,
102
102
  requestType: "json",
@@ -163,7 +163,7 @@ class Templates {
163
163
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
164
164
  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)}/migrate`),
165
165
  method: "POST",
166
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
166
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
167
167
  contentType: "application/json",
168
168
  requestType: "json",
169
169
  body: serializers.agents.TemplatesMigrateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -236,7 +236,7 @@ class Templates {
236
236
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
237
237
  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)}/template`),
238
238
  method: "POST",
239
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
239
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
240
240
  contentType: "application/json",
241
241
  requestType: "json",
242
242
  body: serializers.agents.TemplatesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -76,7 +76,7 @@ class Tools {
76
76
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
77
  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)}/tools`),
78
78
  method: "GET",
79
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
79
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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),
80
80
  contentType: "application/json",
81
81
  requestType: "json",
82
82
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -142,7 +142,7 @@ class Tools {
142
142
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
143
143
  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)}/tools/attach/${encodeURIComponent(toolId)}`),
144
144
  method: "PATCH",
145
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
145
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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
146
  contentType: "application/json",
147
147
  requestType: "json",
148
148
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -208,7 +208,7 @@ class Tools {
208
208
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
209
209
  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)}/tools/detach/${encodeURIComponent(toolId)}`),
210
210
  method: "PATCH",
211
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.47", "User-Agent": "@letta-ai/letta-client/0.1.47", "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),
211
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.49", "User-Agent": "@letta-ai/letta-client/0.1.49", "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
212
  contentType: "application/json",
213
213
  requestType: "json",
214
214
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -12,6 +12,7 @@ export interface AgentsSearchResponseAgentsItemToolsItem {
12
12
  tags?: string[];
13
13
  sourceCode?: Letta.AgentsSearchResponseAgentsItemToolsItemSourceCode;
14
14
  jsonSchema?: Letta.AgentsSearchResponseAgentsItemToolsItemJsonSchema;
15
+ argsJsonSchema?: Letta.AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema;
15
16
  returnCharLimit?: number;
16
17
  createdById?: Letta.AgentsSearchResponseAgentsItemToolsItemCreatedById;
17
18
  lastUpdatedById?: Letta.AgentsSearchResponseAgentsItemToolsItemLastUpdatedById;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Letta from "../../../index";
5
+ export type AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema = unknown | string | undefined | (Letta.AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem | undefined)[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem = unknown | string | undefined;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -111,6 +111,8 @@ export * from "./AgentsSearchResponseAgentsItemToolsItemSourceCodeItem";
111
111
  export * from "./AgentsSearchResponseAgentsItemToolsItemSourceCode";
112
112
  export * from "./AgentsSearchResponseAgentsItemToolsItemJsonSchemaItem";
113
113
  export * from "./AgentsSearchResponseAgentsItemToolsItemJsonSchema";
114
+ export * from "./AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem";
115
+ export * from "./AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema";
114
116
  export * from "./AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem";
115
117
  export * from "./AgentsSearchResponseAgentsItemToolsItemCreatedById";
116
118
  export * from "./AgentsSearchResponseAgentsItemToolsItemLastUpdatedByIdItem";
@@ -127,6 +127,8 @@ __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemSourceCodeItem"),
127
127
  __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemSourceCode"), exports);
128
128
  __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemJsonSchemaItem"), exports);
129
129
  __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemJsonSchema"), exports);
130
+ __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem"), exports);
131
+ __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema"), exports);
130
132
  __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem"), exports);
131
133
  __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemCreatedById"), exports);
132
134
  __exportStar(require("./AgentsSearchResponseAgentsItemToolsItemLastUpdatedByIdItem"), exports);