@letta-ai/letta-client 0.1.82 → 0.1.84

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 (148) hide show
  1. package/api/resources/agents/client/Client.d.ts +2 -2
  2. package/api/resources/agents/client/Client.js +12 -18
  3. package/api/resources/agents/resources/blocks/client/Client.js +5 -5
  4. package/api/resources/agents/resources/context/client/Client.js +1 -1
  5. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  6. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  7. package/api/resources/agents/resources/messages/client/Client.js +5 -5
  8. package/api/resources/agents/resources/passages/client/Client.js +3 -3
  9. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  10. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  11. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  12. package/api/resources/blocks/client/Client.js +6 -6
  13. package/api/resources/groups/client/Client.d.ts +6 -14
  14. package/api/resources/groups/client/Client.js +28 -72
  15. package/api/resources/groups/resources/messages/client/Client.js +4 -4
  16. package/api/resources/groups/types/GroupUpdateManagerConfig.d.ts +1 -1
  17. package/api/resources/health/client/Client.js +1 -1
  18. package/api/resources/identities/client/Client.d.ts +25 -14
  19. package/api/resources/identities/client/Client.js +93 -21
  20. package/api/{types → resources/identities/client/requests}/IdentityCreate.d.ts +10 -1
  21. package/api/resources/identities/client/requests/IdentityUpsert.d.ts +29 -0
  22. package/api/resources/identities/client/requests/index.d.ts +2 -2
  23. package/api/resources/jobs/client/Client.js +4 -4
  24. package/api/resources/models/client/Client.js +2 -2
  25. package/api/resources/providers/client/Client.js +4 -4
  26. package/api/resources/runs/client/Client.js +7 -7
  27. package/api/resources/sources/client/Client.js +6 -6
  28. package/api/resources/sources/resources/files/client/Client.js +3 -3
  29. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  30. package/api/resources/steps/client/Client.js +2 -2
  31. package/api/resources/tag/client/Client.js +1 -1
  32. package/api/resources/templates/client/Client.js +1 -1
  33. package/api/resources/tools/client/Client.js +16 -16
  34. package/api/resources/voice/client/Client.js +1 -1
  35. package/api/types/DynamicManagerUpdate.d.ts +12 -0
  36. package/api/types/RoundRobinManagerUpdate.d.ts +8 -0
  37. package/api/types/SleeptimeManagerUpdate.d.ts +10 -0
  38. package/api/types/SupervisorManagerUpdate.d.ts +8 -0
  39. package/api/types/index.d.ts +4 -1
  40. package/api/types/index.js +4 -1
  41. package/dist/api/resources/agents/client/Client.d.ts +2 -2
  42. package/dist/api/resources/agents/client/Client.js +12 -18
  43. package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
  44. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  45. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  46. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  47. package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
  48. package/dist/api/resources/agents/resources/passages/client/Client.js +3 -3
  49. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  50. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  51. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  52. package/dist/api/resources/blocks/client/Client.js +6 -6
  53. package/dist/api/resources/groups/client/Client.d.ts +6 -14
  54. package/dist/api/resources/groups/client/Client.js +28 -72
  55. package/dist/api/resources/groups/resources/messages/client/Client.js +4 -4
  56. package/dist/api/resources/groups/types/GroupUpdateManagerConfig.d.ts +1 -1
  57. package/dist/api/resources/health/client/Client.js +1 -1
  58. package/dist/api/resources/identities/client/Client.d.ts +25 -14
  59. package/dist/api/resources/identities/client/Client.js +93 -21
  60. package/dist/api/{types → resources/identities/client/requests}/IdentityCreate.d.ts +10 -1
  61. package/dist/api/resources/identities/client/requests/IdentityCreate.js +5 -0
  62. package/dist/api/resources/identities/client/requests/IdentityUpsert.d.ts +29 -0
  63. package/dist/api/resources/identities/client/requests/IdentityUpsert.js +5 -0
  64. package/dist/api/resources/identities/client/requests/index.d.ts +2 -2
  65. package/dist/api/resources/jobs/client/Client.js +4 -4
  66. package/dist/api/resources/models/client/Client.js +2 -2
  67. package/dist/api/resources/providers/client/Client.js +4 -4
  68. package/dist/api/resources/runs/client/Client.js +7 -7
  69. package/dist/api/resources/sources/client/Client.js +6 -6
  70. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  71. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  72. package/dist/api/resources/steps/client/Client.js +2 -2
  73. package/dist/api/resources/tag/client/Client.js +1 -1
  74. package/dist/api/resources/templates/client/Client.js +1 -1
  75. package/dist/api/resources/tools/client/Client.js +16 -16
  76. package/dist/api/resources/voice/client/Client.js +1 -1
  77. package/dist/api/types/DynamicManagerUpdate.d.ts +12 -0
  78. package/dist/api/types/DynamicManagerUpdate.js +5 -0
  79. package/dist/api/types/RoundRobinManagerUpdate.d.ts +8 -0
  80. package/dist/api/types/RoundRobinManagerUpdate.js +5 -0
  81. package/dist/api/types/SleeptimeManagerUpdate.d.ts +10 -0
  82. package/dist/api/types/SleeptimeManagerUpdate.js +5 -0
  83. package/dist/api/types/SupervisorManagerUpdate.d.ts +8 -0
  84. package/dist/api/types/SupervisorManagerUpdate.js +5 -0
  85. package/dist/api/types/index.d.ts +4 -1
  86. package/dist/api/types/index.js +4 -1
  87. package/dist/serialization/resources/groups/types/GroupUpdateManagerConfig.d.ts +5 -5
  88. package/dist/serialization/resources/groups/types/GroupUpdateManagerConfig.js +10 -5
  89. package/dist/serialization/resources/identities/client/index.d.ts +1 -0
  90. package/dist/serialization/resources/identities/client/index.js +2 -1
  91. package/dist/serialization/resources/identities/client/requests/IdentityCreate.d.ts +20 -0
  92. package/dist/serialization/{types → resources/identities/client/requests}/IdentityCreate.js +3 -3
  93. package/dist/serialization/resources/identities/client/requests/IdentityUpsert.d.ts +20 -0
  94. package/dist/serialization/resources/identities/client/requests/IdentityUpsert.js +51 -0
  95. package/dist/serialization/resources/identities/client/requests/index.d.ts +2 -0
  96. package/dist/serialization/resources/identities/client/requests/index.js +5 -1
  97. package/dist/serialization/resources/identities/client/upsertIdentityProperties.d.ts +11 -0
  98. package/dist/serialization/resources/identities/client/upsertIdentityProperties.js +42 -0
  99. package/dist/serialization/types/DynamicManagerUpdate.d.ts +15 -0
  100. package/dist/serialization/types/DynamicManagerUpdate.js +46 -0
  101. package/dist/serialization/types/RoundRobinManagerUpdate.d.ts +13 -0
  102. package/dist/serialization/types/RoundRobinManagerUpdate.js +44 -0
  103. package/dist/serialization/types/SleeptimeManagerUpdate.d.ts +14 -0
  104. package/dist/serialization/types/SleeptimeManagerUpdate.js +45 -0
  105. package/dist/serialization/types/SupervisorManagerUpdate.d.ts +13 -0
  106. package/dist/serialization/types/SupervisorManagerUpdate.js +44 -0
  107. package/dist/serialization/types/index.d.ts +4 -1
  108. package/dist/serialization/types/index.js +4 -1
  109. package/dist/version.d.ts +1 -1
  110. package/dist/version.js +1 -1
  111. package/package.json +1 -1
  112. package/reference.md +79 -69
  113. package/serialization/resources/groups/types/GroupUpdateManagerConfig.d.ts +5 -5
  114. package/serialization/resources/groups/types/GroupUpdateManagerConfig.js +10 -5
  115. package/serialization/resources/identities/client/index.d.ts +1 -0
  116. package/serialization/resources/identities/client/index.js +2 -1
  117. package/serialization/resources/identities/client/requests/IdentityCreate.d.ts +20 -0
  118. package/serialization/{types → resources/identities/client/requests}/IdentityCreate.js +3 -3
  119. package/serialization/resources/identities/client/requests/IdentityUpsert.d.ts +20 -0
  120. package/serialization/resources/identities/client/requests/IdentityUpsert.js +51 -0
  121. package/serialization/resources/identities/client/requests/index.d.ts +2 -0
  122. package/serialization/resources/identities/client/requests/index.js +5 -1
  123. package/serialization/resources/identities/client/upsertIdentityProperties.d.ts +11 -0
  124. package/serialization/resources/identities/client/upsertIdentityProperties.js +42 -0
  125. package/serialization/types/DynamicManagerUpdate.d.ts +15 -0
  126. package/serialization/types/DynamicManagerUpdate.js +46 -0
  127. package/serialization/types/RoundRobinManagerUpdate.d.ts +13 -0
  128. package/serialization/types/RoundRobinManagerUpdate.js +44 -0
  129. package/serialization/types/SleeptimeManagerUpdate.d.ts +14 -0
  130. package/serialization/types/SleeptimeManagerUpdate.js +45 -0
  131. package/serialization/types/SupervisorManagerUpdate.d.ts +13 -0
  132. package/serialization/types/SupervisorManagerUpdate.js +44 -0
  133. package/serialization/types/index.d.ts +4 -1
  134. package/serialization/types/index.js +4 -1
  135. package/version.d.ts +1 -1
  136. package/version.js +1 -1
  137. package/api/resources/identities/client/requests/IdentitiesCreateRequest.d.ts +0 -18
  138. package/api/resources/identities/client/requests/IdentitiesUpsertRequest.d.ts +0 -18
  139. package/dist/api/resources/identities/client/requests/IdentitiesCreateRequest.d.ts +0 -18
  140. package/dist/api/resources/identities/client/requests/IdentitiesUpsertRequest.d.ts +0 -18
  141. package/dist/serialization/types/IdentityCreate.d.ts +0 -20
  142. package/serialization/types/IdentityCreate.d.ts +0 -20
  143. /package/api/{types → resources/identities/client/requests}/IdentityCreate.js +0 -0
  144. /package/api/resources/identities/client/requests/{IdentitiesCreateRequest.js → IdentityUpsert.js} +0 -0
  145. /package/api/{resources/identities/client/requests/IdentitiesUpsertRequest.js → types/DynamicManagerUpdate.js} +0 -0
  146. /package/{dist/api/resources/identities/client/requests/IdentitiesCreateRequest.js → api/types/RoundRobinManagerUpdate.js} +0 -0
  147. /package/{dist/api/resources/identities/client/requests/IdentitiesUpsertRequest.js → api/types/SleeptimeManagerUpdate.js} +0 -0
  148. /package/{dist/api/types/IdentityCreate.js → api/types/SupervisorManagerUpdate.js} +0 -0
@@ -68,19 +68,6 @@ export declare class Groups {
68
68
  * await client.groups.retrieve("group_id")
69
69
  */
70
70
  retrieve(groupId: string, requestOptions?: Groups.RequestOptions): Promise<Letta.Group>;
71
- /**
72
- * Create a new multi-agent group with the specified configuration.
73
- *
74
- * @param {string} groupId
75
- * @param {Letta.GroupUpdate} request
76
- * @param {Groups.RequestOptions} requestOptions - Request-specific configuration.
77
- *
78
- * @throws {@link Letta.UnprocessableEntityError}
79
- *
80
- * @example
81
- * await client.groups.modifyGroup("group_id")
82
- */
83
- modifyGroup(groupId: string, request?: Letta.GroupUpdate, requestOptions?: Groups.RequestOptions): Promise<Letta.Group>;
84
71
  /**
85
72
  * Delete a multi-agent group.
86
73
  *
@@ -94,13 +81,18 @@ export declare class Groups {
94
81
  */
95
82
  delete(groupId: string, requestOptions?: Groups.RequestOptions): Promise<unknown>;
96
83
  /**
84
+ * Create a new multi-agent group with the specified configuration.
85
+ *
97
86
  * @param {string} groupId
87
+ * @param {Letta.GroupUpdate} request
98
88
  * @param {Groups.RequestOptions} requestOptions - Request-specific configuration.
99
89
  *
90
+ * @throws {@link Letta.UnprocessableEntityError}
91
+ *
100
92
  * @example
101
93
  * await client.groups.modify("group_id")
102
94
  */
103
- modify(groupId: string, requestOptions?: Groups.RequestOptions): Promise<void>;
95
+ modify(groupId: string, request?: Letta.GroupUpdate, requestOptions?: Groups.RequestOptions): Promise<Letta.Group>;
104
96
  /**
105
97
  * Delete the group messages for all agents that are part of the multi-agent group.
106
98
  *
@@ -109,7 +109,7 @@ class Groups {
109
109
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
110
110
  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/groups/"),
111
111
  method: "GET",
112
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
112
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
113
113
  contentType: "application/json",
114
114
  queryParameters: _queryParams,
115
115
  requestType: "json",
@@ -179,7 +179,7 @@ class Groups {
179
179
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
180
180
  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/groups/"),
181
181
  method: "POST",
182
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
182
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
183
183
  contentType: "application/json",
184
184
  requestType: "json",
185
185
  body: serializers.GroupCreate.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
@@ -245,7 +245,7 @@ class Groups {
245
245
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
246
246
  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/groups/${encodeURIComponent(groupId)}`),
247
247
  method: "GET",
248
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
248
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
249
249
  contentType: "application/json",
250
250
  requestType: "json",
251
251
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -294,40 +294,31 @@ class Groups {
294
294
  });
295
295
  }
296
296
  /**
297
- * Create a new multi-agent group with the specified configuration.
297
+ * Delete a multi-agent group.
298
298
  *
299
299
  * @param {string} groupId
300
- * @param {Letta.GroupUpdate} request
301
300
  * @param {Groups.RequestOptions} requestOptions - Request-specific configuration.
302
301
  *
303
302
  * @throws {@link Letta.UnprocessableEntityError}
304
303
  *
305
304
  * @example
306
- * await client.groups.modifyGroup("group_id")
305
+ * await client.groups.delete("group_id")
307
306
  */
308
- modifyGroup(groupId_1) {
309
- return __awaiter(this, arguments, void 0, function* (groupId, request = {}, requestOptions) {
307
+ delete(groupId, requestOptions) {
308
+ return __awaiter(this, void 0, void 0, function* () {
310
309
  var _a, _b, _c;
311
- const { project } = request, _body = __rest(request, ["project"]);
312
310
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
313
311
  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/groups/${encodeURIComponent(groupId)}`),
314
- method: "PUT",
315
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
312
+ method: "DELETE",
313
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
316
314
  contentType: "application/json",
317
315
  requestType: "json",
318
- body: serializers.GroupUpdate.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
319
316
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
320
317
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
321
318
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
322
319
  });
323
320
  if (_response.ok) {
324
- return serializers.Group.parseOrThrow(_response.body, {
325
- unrecognizedObjectKeys: "passthrough",
326
- allowUnrecognizedUnionMembers: true,
327
- allowUnrecognizedEnumValues: true,
328
- skipValidation: true,
329
- breadcrumbsPrefix: ["response"],
330
- });
321
+ return _response.body;
331
322
  }
332
323
  if (_response.error.reason === "status-code") {
333
324
  switch (_response.error.statusCode) {
@@ -353,7 +344,7 @@ class Groups {
353
344
  body: _response.error.rawBody,
354
345
  });
355
346
  case "timeout":
356
- throw new errors.LettaTimeoutError("Timeout exceeded when calling PUT /v1/groups/{group_id}.");
347
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/groups/{group_id}.");
357
348
  case "unknown":
358
349
  throw new errors.LettaError({
359
350
  message: _response.error.errorMessage,
@@ -362,31 +353,40 @@ class Groups {
362
353
  });
363
354
  }
364
355
  /**
365
- * Delete a multi-agent group.
356
+ * Create a new multi-agent group with the specified configuration.
366
357
  *
367
358
  * @param {string} groupId
359
+ * @param {Letta.GroupUpdate} request
368
360
  * @param {Groups.RequestOptions} requestOptions - Request-specific configuration.
369
361
  *
370
362
  * @throws {@link Letta.UnprocessableEntityError}
371
363
  *
372
364
  * @example
373
- * await client.groups.delete("group_id")
365
+ * await client.groups.modify("group_id")
374
366
  */
375
- delete(groupId, requestOptions) {
376
- return __awaiter(this, void 0, void 0, function* () {
367
+ modify(groupId_1) {
368
+ return __awaiter(this, arguments, void 0, function* (groupId, request = {}, requestOptions) {
377
369
  var _a, _b, _c;
370
+ const { project } = request, _body = __rest(request, ["project"]);
378
371
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
379
372
  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/groups/${encodeURIComponent(groupId)}`),
380
- method: "DELETE",
381
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
373
+ method: "PATCH",
374
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
382
375
  contentType: "application/json",
383
376
  requestType: "json",
377
+ body: serializers.GroupUpdate.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
384
378
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
385
379
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
386
380
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
387
381
  });
388
382
  if (_response.ok) {
389
- return _response.body;
383
+ return serializers.Group.parseOrThrow(_response.body, {
384
+ unrecognizedObjectKeys: "passthrough",
385
+ allowUnrecognizedUnionMembers: true,
386
+ allowUnrecognizedEnumValues: true,
387
+ skipValidation: true,
388
+ breadcrumbsPrefix: ["response"],
389
+ });
390
390
  }
391
391
  if (_response.error.reason === "status-code") {
392
392
  switch (_response.error.statusCode) {
@@ -405,50 +405,6 @@ class Groups {
405
405
  });
406
406
  }
407
407
  }
408
- switch (_response.error.reason) {
409
- case "non-json":
410
- throw new errors.LettaError({
411
- statusCode: _response.error.statusCode,
412
- body: _response.error.rawBody,
413
- });
414
- case "timeout":
415
- throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/groups/{group_id}.");
416
- case "unknown":
417
- throw new errors.LettaError({
418
- message: _response.error.errorMessage,
419
- });
420
- }
421
- });
422
- }
423
- /**
424
- * @param {string} groupId
425
- * @param {Groups.RequestOptions} requestOptions - Request-specific configuration.
426
- *
427
- * @example
428
- * await client.groups.modify("group_id")
429
- */
430
- modify(groupId, requestOptions) {
431
- return __awaiter(this, void 0, void 0, function* () {
432
- var _a, _b, _c;
433
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
434
- 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/groups/${encodeURIComponent(groupId)}`),
435
- method: "PATCH",
436
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
437
- contentType: "application/json",
438
- requestType: "json",
439
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
440
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
441
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
442
- });
443
- if (_response.ok) {
444
- return;
445
- }
446
- if (_response.error.reason === "status-code") {
447
- throw new errors.LettaError({
448
- statusCode: _response.error.statusCode,
449
- body: _response.error.body,
450
- });
451
- }
452
408
  switch (_response.error.reason) {
453
409
  case "non-json":
454
410
  throw new errors.LettaError({
@@ -481,7 +437,7 @@ class Groups {
481
437
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
482
438
  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/groups/${encodeURIComponent(groupId)}/reset-messages`),
483
439
  method: "PATCH",
484
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
440
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
485
441
  contentType: "application/json",
486
442
  requestType: "json",
487
443
  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/groups/${encodeURIComponent(groupId)}/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.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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",
@@ -173,7 +173,7 @@ class Messages {
173
173
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
174
174
  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/groups/${encodeURIComponent(groupId)}/messages`),
175
175
  method: "POST",
176
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
176
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
177
177
  contentType: "application/json",
178
178
  requestType: "json",
179
179
  body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -233,7 +233,7 @@ class Messages {
233
233
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
234
234
  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/groups/${encodeURIComponent(groupId)}/messages/stream`),
235
235
  method: "POST",
236
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
236
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
237
237
  contentType: "application/json",
238
238
  requestType: "json",
239
239
  body: serializers.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -314,7 +314,7 @@ class Messages {
314
314
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
315
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/groups/${encodeURIComponent(groupId)}/messages/${encodeURIComponent(messageId)}`),
316
316
  method: "PATCH",
317
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
317
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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
318
  contentType: "application/json",
319
319
  requestType: "json",
320
320
  body: serializers.groups.MessagesModifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Letta from "../../../index";
5
- export type GroupUpdateManagerConfig = Letta.DynamicManager | Letta.RoundRobinManager | Letta.SleeptimeManager | Letta.SupervisorManager;
5
+ export type GroupUpdateManagerConfig = Letta.DynamicManagerUpdate | Letta.RoundRobinManagerUpdate | Letta.SleeptimeManagerUpdate | Letta.SupervisorManagerUpdate;
@@ -70,7 +70,7 @@ class Health {
70
70
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
71
  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/health/"),
72
72
  method: "GET",
73
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
73
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
74
74
  contentType: "application/json",
75
75
  requestType: "json",
76
76
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -39,37 +39,33 @@ export declare class Identities {
39
39
  */
40
40
  list(request?: Letta.IdentitiesListRequest, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity[]>;
41
41
  /**
42
- * @param {Letta.IdentitiesCreateRequest} request
42
+ * @param {Letta.IdentityCreate} request
43
43
  * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
44
44
  *
45
45
  * @throws {@link Letta.UnprocessableEntityError}
46
46
  *
47
47
  * @example
48
48
  * await client.identities.create({
49
- * body: {
50
- * identifierKey: "identifier_key",
51
- * name: "name",
52
- * identityType: "org"
53
- * }
49
+ * identifierKey: "identifier_key",
50
+ * name: "name",
51
+ * identityType: "org"
54
52
  * })
55
53
  */
56
- create(request: Letta.IdentitiesCreateRequest, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity>;
54
+ create(request: Letta.IdentityCreate, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity>;
57
55
  /**
58
- * @param {Letta.IdentitiesUpsertRequest} request
56
+ * @param {Letta.IdentityUpsert} request
59
57
  * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
60
58
  *
61
59
  * @throws {@link Letta.UnprocessableEntityError}
62
60
  *
63
61
  * @example
64
62
  * await client.identities.upsert({
65
- * body: {
66
- * identifierKey: "identifier_key",
67
- * name: "name",
68
- * identityType: "org"
69
- * }
63
+ * identifierKey: "identifier_key",
64
+ * name: "name",
65
+ * identityType: "org"
70
66
  * })
71
67
  */
72
- upsert(request: Letta.IdentitiesUpsertRequest, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity>;
68
+ upsert(request: Letta.IdentityUpsert, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity>;
73
69
  /**
74
70
  * @param {string} identityId
75
71
  * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
@@ -103,6 +99,21 @@ export declare class Identities {
103
99
  * await client.identities.modify("identity_id")
104
100
  */
105
101
  modify(identityId: string, request?: Letta.IdentityUpdate, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity>;
102
+ /**
103
+ * @param {string} identityId
104
+ * @param {Letta.IdentityProperty[]} request
105
+ * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
106
+ *
107
+ * @throws {@link Letta.UnprocessableEntityError}
108
+ *
109
+ * @example
110
+ * await client.identities.upsertIdentityProperties("identity_id", [{
111
+ * key: "key",
112
+ * value: "value",
113
+ * type: "string"
114
+ * }])
115
+ */
116
+ upsertIdentityProperties(identityId: string, request: Letta.IdentityProperty[], requestOptions?: Identities.RequestOptions): Promise<unknown>;
106
117
  protected _getCustomAuthorizationHeaders(): Promise<{
107
118
  Authorization: string;
108
119
  }>;
@@ -44,6 +44,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
44
44
  step((generator = generator.apply(thisArg, _arguments || [])).next());
45
45
  });
46
46
  };
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
47
58
  var __importDefault = (this && this.__importDefault) || function (mod) {
48
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
49
60
  };
@@ -99,7 +110,7 @@ class Identities {
99
110
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
100
111
  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/identities/"),
101
112
  method: "GET",
102
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
113
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
103
114
  contentType: "application/json",
104
115
  queryParameters: _queryParams,
105
116
  requestType: "json",
@@ -149,28 +160,26 @@ class Identities {
149
160
  });
150
161
  }
151
162
  /**
152
- * @param {Letta.IdentitiesCreateRequest} request
163
+ * @param {Letta.IdentityCreate} request
153
164
  * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
154
165
  *
155
166
  * @throws {@link Letta.UnprocessableEntityError}
156
167
  *
157
168
  * @example
158
169
  * await client.identities.create({
159
- * body: {
160
- * identifierKey: "identifier_key",
161
- * name: "name",
162
- * identityType: "org"
163
- * }
170
+ * identifierKey: "identifier_key",
171
+ * name: "name",
172
+ * identityType: "org"
164
173
  * })
165
174
  */
166
175
  create(request, requestOptions) {
167
176
  return __awaiter(this, void 0, void 0, function* () {
168
177
  var _a, _b, _c;
169
- const { project, body: _body } = request;
178
+ const { project } = request, _body = __rest(request, ["project"]);
170
179
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
171
180
  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/identities/"),
172
181
  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.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
182
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
174
183
  contentType: "application/json",
175
184
  requestType: "json",
176
185
  body: serializers.IdentityCreate.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
@@ -220,31 +229,29 @@ class Identities {
220
229
  });
221
230
  }
222
231
  /**
223
- * @param {Letta.IdentitiesUpsertRequest} request
232
+ * @param {Letta.IdentityUpsert} request
224
233
  * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
225
234
  *
226
235
  * @throws {@link Letta.UnprocessableEntityError}
227
236
  *
228
237
  * @example
229
238
  * await client.identities.upsert({
230
- * body: {
231
- * identifierKey: "identifier_key",
232
- * name: "name",
233
- * identityType: "org"
234
- * }
239
+ * identifierKey: "identifier_key",
240
+ * name: "name",
241
+ * identityType: "org"
235
242
  * })
236
243
  */
237
244
  upsert(request, requestOptions) {
238
245
  return __awaiter(this, void 0, void 0, function* () {
239
246
  var _a, _b, _c;
240
- const { project, body: _body } = request;
247
+ const { project } = request, _body = __rest(request, ["project"]);
241
248
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
242
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/identities/"),
243
250
  method: "PUT",
244
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
245
252
  contentType: "application/json",
246
253
  requestType: "json",
247
- body: serializers.IdentityCreate.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
254
+ body: serializers.IdentityUpsert.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
248
255
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
249
256
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
250
257
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -305,7 +312,7 @@ class Identities {
305
312
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
306
313
  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/identities/${encodeURIComponent(identityId)}`),
307
314
  method: "GET",
308
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
315
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
309
316
  contentType: "application/json",
310
317
  requestType: "json",
311
318
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -370,7 +377,7 @@ class Identities {
370
377
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
371
378
  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/identities/${encodeURIComponent(identityId)}`),
372
379
  method: "DELETE",
373
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
380
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
374
381
  contentType: "application/json",
375
382
  requestType: "json",
376
383
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -428,7 +435,7 @@ class Identities {
428
435
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
429
436
  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/identities/${encodeURIComponent(identityId)}`),
430
437
  method: "PATCH",
431
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.82", "User-Agent": "@letta-ai/letta-client/0.1.82", "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),
438
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
432
439
  contentType: "application/json",
433
440
  requestType: "json",
434
441
  body: serializers.IdentityUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -477,6 +484,71 @@ class Identities {
477
484
  }
478
485
  });
479
486
  }
487
+ /**
488
+ * @param {string} identityId
489
+ * @param {Letta.IdentityProperty[]} request
490
+ * @param {Identities.RequestOptions} requestOptions - Request-specific configuration.
491
+ *
492
+ * @throws {@link Letta.UnprocessableEntityError}
493
+ *
494
+ * @example
495
+ * await client.identities.upsertIdentityProperties("identity_id", [{
496
+ * key: "key",
497
+ * value: "value",
498
+ * type: "string"
499
+ * }])
500
+ */
501
+ upsertIdentityProperties(identityId, request, requestOptions) {
502
+ return __awaiter(this, void 0, void 0, function* () {
503
+ var _a, _b, _c;
504
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
505
+ 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/identities/${encodeURIComponent(identityId)}/properties`),
506
+ method: "PUT",
507
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.84", "User-Agent": "@letta-ai/letta-client/0.1.84", "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),
508
+ contentType: "application/json",
509
+ requestType: "json",
510
+ body: serializers.identities.upsertIdentityProperties.Request.jsonOrThrow(request, {
511
+ unrecognizedObjectKeys: "strip",
512
+ }),
513
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
514
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
515
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
516
+ });
517
+ if (_response.ok) {
518
+ return _response.body;
519
+ }
520
+ if (_response.error.reason === "status-code") {
521
+ switch (_response.error.statusCode) {
522
+ case 422:
523
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
524
+ unrecognizedObjectKeys: "passthrough",
525
+ allowUnrecognizedUnionMembers: true,
526
+ allowUnrecognizedEnumValues: true,
527
+ skipValidation: true,
528
+ breadcrumbsPrefix: ["response"],
529
+ }));
530
+ default:
531
+ throw new errors.LettaError({
532
+ statusCode: _response.error.statusCode,
533
+ body: _response.error.body,
534
+ });
535
+ }
536
+ }
537
+ switch (_response.error.reason) {
538
+ case "non-json":
539
+ throw new errors.LettaError({
540
+ statusCode: _response.error.statusCode,
541
+ body: _response.error.rawBody,
542
+ });
543
+ case "timeout":
544
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling PUT /v1/identities/{identity_id}/properties.");
545
+ case "unknown":
546
+ throw new errors.LettaError({
547
+ message: _response.error.errorMessage,
548
+ });
549
+ }
550
+ });
551
+ }
480
552
  _getCustomAuthorizationHeaders() {
481
553
  return __awaiter(this, void 0, void 0, function* () {
482
554
  const tokenValue = yield core.Supplier.get(this._options.token);
@@ -1,8 +1,17 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Letta from "../index";
4
+ import * as Letta from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * identifierKey: "identifier_key",
9
+ * name: "name",
10
+ * identityType: "org"
11
+ * }
12
+ */
5
13
  export interface IdentityCreate {
14
+ project?: string;
6
15
  /** External, user-generated identifier key of the identity. */
7
16
  identifierKey: string;
8
17
  /** The name of the identity. */
@@ -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 });