@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.
- package/api/resources/agents/client/Client.d.ts +2 -2
- package/api/resources/agents/client/Client.js +12 -18
- package/api/resources/agents/resources/blocks/client/Client.js +5 -5
- package/api/resources/agents/resources/context/client/Client.js +1 -1
- package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/api/resources/agents/resources/messages/client/Client.js +5 -5
- package/api/resources/agents/resources/passages/client/Client.js +3 -3
- package/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/api/resources/blocks/client/Client.js +6 -6
- package/api/resources/groups/client/Client.d.ts +6 -14
- package/api/resources/groups/client/Client.js +28 -72
- package/api/resources/groups/resources/messages/client/Client.js +4 -4
- package/api/resources/groups/types/GroupUpdateManagerConfig.d.ts +1 -1
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/identities/client/Client.d.ts +25 -14
- package/api/resources/identities/client/Client.js +93 -21
- package/api/{types → resources/identities/client/requests}/IdentityCreate.d.ts +10 -1
- package/api/resources/identities/client/requests/IdentityUpsert.d.ts +29 -0
- package/api/resources/identities/client/requests/index.d.ts +2 -2
- package/api/resources/jobs/client/Client.js +4 -4
- package/api/resources/models/client/Client.js +2 -2
- package/api/resources/providers/client/Client.js +4 -4
- package/api/resources/runs/client/Client.js +7 -7
- package/api/resources/sources/client/Client.js +6 -6
- package/api/resources/sources/resources/files/client/Client.js +3 -3
- package/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/api/resources/steps/client/Client.js +2 -2
- package/api/resources/tag/client/Client.js +1 -1
- package/api/resources/templates/client/Client.js +1 -1
- package/api/resources/tools/client/Client.js +16 -16
- package/api/resources/voice/client/Client.js +1 -1
- package/api/types/DynamicManagerUpdate.d.ts +12 -0
- package/api/types/RoundRobinManagerUpdate.d.ts +8 -0
- package/api/types/SleeptimeManagerUpdate.d.ts +10 -0
- package/api/types/SupervisorManagerUpdate.d.ts +8 -0
- package/api/types/index.d.ts +4 -1
- package/api/types/index.js +4 -1
- package/dist/api/resources/agents/client/Client.d.ts +2 -2
- package/dist/api/resources/agents/client/Client.js +12 -18
- package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
- package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/messages/client/Client.js +5 -5
- package/dist/api/resources/agents/resources/passages/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/dist/api/resources/blocks/client/Client.js +6 -6
- package/dist/api/resources/groups/client/Client.d.ts +6 -14
- package/dist/api/resources/groups/client/Client.js +28 -72
- package/dist/api/resources/groups/resources/messages/client/Client.js +4 -4
- package/dist/api/resources/groups/types/GroupUpdateManagerConfig.d.ts +1 -1
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/identities/client/Client.d.ts +25 -14
- package/dist/api/resources/identities/client/Client.js +93 -21
- package/dist/api/{types → resources/identities/client/requests}/IdentityCreate.d.ts +10 -1
- package/dist/api/resources/identities/client/requests/IdentityCreate.js +5 -0
- package/dist/api/resources/identities/client/requests/IdentityUpsert.d.ts +29 -0
- package/dist/api/resources/identities/client/requests/IdentityUpsert.js +5 -0
- package/dist/api/resources/identities/client/requests/index.d.ts +2 -2
- package/dist/api/resources/jobs/client/Client.js +4 -4
- package/dist/api/resources/models/client/Client.js +2 -2
- package/dist/api/resources/providers/client/Client.js +4 -4
- package/dist/api/resources/runs/client/Client.js +7 -7
- package/dist/api/resources/sources/client/Client.js +6 -6
- package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
- package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/steps/client/Client.js +2 -2
- package/dist/api/resources/tag/client/Client.js +1 -1
- package/dist/api/resources/templates/client/Client.js +1 -1
- package/dist/api/resources/tools/client/Client.js +16 -16
- package/dist/api/resources/voice/client/Client.js +1 -1
- package/dist/api/types/DynamicManagerUpdate.d.ts +12 -0
- package/dist/api/types/DynamicManagerUpdate.js +5 -0
- package/dist/api/types/RoundRobinManagerUpdate.d.ts +8 -0
- package/dist/api/types/RoundRobinManagerUpdate.js +5 -0
- package/dist/api/types/SleeptimeManagerUpdate.d.ts +10 -0
- package/dist/api/types/SleeptimeManagerUpdate.js +5 -0
- package/dist/api/types/SupervisorManagerUpdate.d.ts +8 -0
- package/dist/api/types/SupervisorManagerUpdate.js +5 -0
- package/dist/api/types/index.d.ts +4 -1
- package/dist/api/types/index.js +4 -1
- package/dist/serialization/resources/groups/types/GroupUpdateManagerConfig.d.ts +5 -5
- package/dist/serialization/resources/groups/types/GroupUpdateManagerConfig.js +10 -5
- package/dist/serialization/resources/identities/client/index.d.ts +1 -0
- package/dist/serialization/resources/identities/client/index.js +2 -1
- package/dist/serialization/resources/identities/client/requests/IdentityCreate.d.ts +20 -0
- package/dist/serialization/{types → resources/identities/client/requests}/IdentityCreate.js +3 -3
- package/dist/serialization/resources/identities/client/requests/IdentityUpsert.d.ts +20 -0
- package/dist/serialization/resources/identities/client/requests/IdentityUpsert.js +51 -0
- package/dist/serialization/resources/identities/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/identities/client/requests/index.js +5 -1
- package/dist/serialization/resources/identities/client/upsertIdentityProperties.d.ts +11 -0
- package/dist/serialization/resources/identities/client/upsertIdentityProperties.js +42 -0
- package/dist/serialization/types/DynamicManagerUpdate.d.ts +15 -0
- package/dist/serialization/types/DynamicManagerUpdate.js +46 -0
- package/dist/serialization/types/RoundRobinManagerUpdate.d.ts +13 -0
- package/dist/serialization/types/RoundRobinManagerUpdate.js +44 -0
- package/dist/serialization/types/SleeptimeManagerUpdate.d.ts +14 -0
- package/dist/serialization/types/SleeptimeManagerUpdate.js +45 -0
- package/dist/serialization/types/SupervisorManagerUpdate.d.ts +13 -0
- package/dist/serialization/types/SupervisorManagerUpdate.js +44 -0
- package/dist/serialization/types/index.d.ts +4 -1
- package/dist/serialization/types/index.js +4 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +79 -69
- package/serialization/resources/groups/types/GroupUpdateManagerConfig.d.ts +5 -5
- package/serialization/resources/groups/types/GroupUpdateManagerConfig.js +10 -5
- package/serialization/resources/identities/client/index.d.ts +1 -0
- package/serialization/resources/identities/client/index.js +2 -1
- package/serialization/resources/identities/client/requests/IdentityCreate.d.ts +20 -0
- package/serialization/{types → resources/identities/client/requests}/IdentityCreate.js +3 -3
- package/serialization/resources/identities/client/requests/IdentityUpsert.d.ts +20 -0
- package/serialization/resources/identities/client/requests/IdentityUpsert.js +51 -0
- package/serialization/resources/identities/client/requests/index.d.ts +2 -0
- package/serialization/resources/identities/client/requests/index.js +5 -1
- package/serialization/resources/identities/client/upsertIdentityProperties.d.ts +11 -0
- package/serialization/resources/identities/client/upsertIdentityProperties.js +42 -0
- package/serialization/types/DynamicManagerUpdate.d.ts +15 -0
- package/serialization/types/DynamicManagerUpdate.js +46 -0
- package/serialization/types/RoundRobinManagerUpdate.d.ts +13 -0
- package/serialization/types/RoundRobinManagerUpdate.js +44 -0
- package/serialization/types/SleeptimeManagerUpdate.d.ts +14 -0
- package/serialization/types/SleeptimeManagerUpdate.js +45 -0
- package/serialization/types/SupervisorManagerUpdate.d.ts +13 -0
- package/serialization/types/SupervisorManagerUpdate.js +44 -0
- package/serialization/types/index.d.ts +4 -1
- package/serialization/types/index.js +4 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/identities/client/requests/IdentitiesCreateRequest.d.ts +0 -18
- package/api/resources/identities/client/requests/IdentitiesUpsertRequest.d.ts +0 -18
- package/dist/api/resources/identities/client/requests/IdentitiesCreateRequest.d.ts +0 -18
- package/dist/api/resources/identities/client/requests/IdentitiesUpsertRequest.d.ts +0 -18
- package/dist/serialization/types/IdentityCreate.d.ts +0 -20
- package/serialization/types/IdentityCreate.d.ts +0 -20
- /package/api/{types → resources/identities/client/requests}/IdentityCreate.js +0 -0
- /package/api/resources/identities/client/requests/{IdentitiesCreateRequest.js → IdentityUpsert.js} +0 -0
- /package/api/{resources/identities/client/requests/IdentitiesUpsertRequest.js → types/DynamicManagerUpdate.js} +0 -0
- /package/{dist/api/resources/identities/client/requests/IdentitiesCreateRequest.js → api/types/RoundRobinManagerUpdate.js} +0 -0
- /package/{dist/api/resources/identities/client/requests/IdentitiesUpsertRequest.js → api/types/SleeptimeManagerUpdate.js} +0 -0
- /package/{dist/api/types/IdentityCreate.js → api/types/SupervisorManagerUpdate.js} +0 -0
|
@@ -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.
|
|
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.
|
|
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.
|
|
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
|
-
*
|
|
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.
|
|
305
|
+
* await client.groups.delete("group_id")
|
|
307
306
|
*/
|
|
308
|
-
|
|
309
|
-
return __awaiter(this,
|
|
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: "
|
|
315
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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.
|
|
365
|
+
* await client.groups.modify("group_id")
|
|
374
366
|
*/
|
|
375
|
-
|
|
376
|
-
return __awaiter(this,
|
|
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: "
|
|
381
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* identityType: "org"
|
|
53
|
-
* }
|
|
49
|
+
* identifierKey: "identifier_key",
|
|
50
|
+
* name: "name",
|
|
51
|
+
* identityType: "org"
|
|
54
52
|
* })
|
|
55
53
|
*/
|
|
56
|
-
create(request: Letta.
|
|
54
|
+
create(request: Letta.IdentityCreate, requestOptions?: Identities.RequestOptions): Promise<Letta.Identity>;
|
|
57
55
|
/**
|
|
58
|
-
* @param {Letta.
|
|
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
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* identityType: "org"
|
|
69
|
-
* }
|
|
63
|
+
* identifierKey: "identifier_key",
|
|
64
|
+
* name: "name",
|
|
65
|
+
* identityType: "org"
|
|
70
66
|
* })
|
|
71
67
|
*/
|
|
72
|
-
upsert(request: Letta.
|
|
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.
|
|
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.
|
|
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
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
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,
|
|
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.
|
|
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.
|
|
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
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
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,
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 "
|
|
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,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Letta from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* identifierKey: "identifier_key",
|
|
9
|
+
* name: "name",
|
|
10
|
+
* identityType: "org"
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface IdentityUpsert {
|
|
14
|
+
project?: string;
|
|
15
|
+
/** External, user-generated identifier key of the identity. */
|
|
16
|
+
identifierKey: string;
|
|
17
|
+
/** The name of the identity. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** The type of the identity. */
|
|
20
|
+
identityType: Letta.IdentityType;
|
|
21
|
+
/** The project id of the identity, if applicable. */
|
|
22
|
+
projectId?: string;
|
|
23
|
+
/** The agent ids that are associated with the identity. */
|
|
24
|
+
agentIds?: string[];
|
|
25
|
+
/** The IDs of the blocks associated with the identity. */
|
|
26
|
+
blockIds?: string[];
|
|
27
|
+
/** List of properties associated with the identity. */
|
|
28
|
+
properties?: Letta.IdentityProperty[];
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type IdentitiesListRequest } from "./IdentitiesListRequest";
|
|
2
|
-
export { type
|
|
3
|
-
export { type
|
|
2
|
+
export { type IdentityCreate } from "./IdentityCreate";
|
|
3
|
+
export { type IdentityUpsert } from "./IdentityUpsert";
|
|
4
4
|
export { type IdentityUpdate } from "./IdentityUpdate";
|