@letta-ai/letta-client 0.1.170 → 0.1.172
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/README.md +16 -3
- package/api/errors/BadRequestError.d.ts +2 -1
- package/api/errors/BadRequestError.js +2 -1
- package/api/errors/ConflictError.d.ts +2 -1
- package/api/errors/ConflictError.js +2 -1
- package/api/errors/InternalServerError.d.ts +2 -1
- package/api/errors/InternalServerError.js +2 -1
- package/api/errors/NotFoundError.d.ts +2 -1
- package/api/errors/NotFoundError.js +2 -1
- package/api/errors/PaymentRequiredError.d.ts +2 -1
- package/api/errors/PaymentRequiredError.js +2 -1
- package/api/errors/UnprocessableEntityError.d.ts +2 -1
- package/api/errors/UnprocessableEntityError.js +2 -1
- package/api/resources/agents/client/Client.d.ts +20 -10
- package/api/resources/agents/client/Client.js +166 -82
- package/api/resources/agents/resources/blocks/client/Client.d.ts +10 -5
- package/api/resources/agents/resources/blocks/client/Client.js +90 -45
- package/api/resources/agents/resources/context/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/context/client/Client.js +18 -9
- package/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/coreMemory/client/Client.js +18 -9
- package/api/resources/agents/resources/files/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/files/client/Client.js +45 -21
- package/api/resources/agents/resources/folders/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/folders/client/Client.js +54 -27
- package/api/resources/agents/resources/groups/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/groups/client/Client.js +19 -10
- package/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -1
- package/api/resources/agents/resources/memoryVariables/client/Client.js +18 -9
- package/api/resources/agents/resources/messages/client/Client.d.ts +16 -8
- package/api/resources/agents/resources/messages/client/Client.js +155 -83
- package/api/resources/agents/resources/passages/client/Client.d.ts +8 -4
- package/api/resources/agents/resources/passages/client/Client.js +64 -31
- package/api/resources/agents/resources/sources/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/sources/client/Client.js +54 -27
- package/api/resources/agents/resources/templates/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/templates/client/Client.js +54 -27
- package/api/resources/agents/resources/tools/client/Client.d.ts +6 -3
- package/api/resources/agents/resources/tools/client/Client.js +54 -27
- package/api/resources/batches/client/Client.d.ts +8 -4
- package/api/resources/batches/client/Client.js +63 -30
- package/api/resources/blocks/client/Client.d.ts +12 -6
- package/api/resources/blocks/client/Client.js +100 -49
- package/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
- package/api/resources/blocks/resources/agents/client/Client.js +19 -10
- package/api/resources/clientSideAccessTokens/client/Client.d.ts +6 -3
- package/api/resources/clientSideAccessTokens/client/Client.js +46 -22
- package/api/resources/embeddingModels/client/Client.d.ts +2 -1
- package/api/resources/embeddingModels/client/Client.js +18 -9
- package/api/resources/folders/client/Client.d.ts +18 -9
- package/api/resources/folders/client/Client.js +154 -76
- package/api/resources/folders/resources/files/client/Client.d.ts +6 -3
- package/api/resources/folders/resources/files/client/Client.js +48 -24
- package/api/resources/folders/resources/passages/client/Client.d.ts +2 -1
- package/api/resources/folders/resources/passages/client/Client.js +19 -10
- package/api/resources/groups/client/Client.d.ts +12 -6
- package/api/resources/groups/client/Client.js +105 -52
- package/api/resources/groups/resources/messages/client/Client.d.ts +10 -5
- package/api/resources/groups/resources/messages/client/Client.js +91 -49
- package/api/resources/health/client/Client.d.ts +2 -1
- package/api/resources/health/client/Client.js +17 -8
- package/api/resources/identities/client/Client.d.ts +14 -7
- package/api/resources/identities/client/Client.js +123 -61
- package/api/resources/identities/resources/properties/client/Client.d.ts +2 -1
- package/api/resources/identities/resources/properties/client/Client.js +9 -3
- package/api/resources/jobs/client/Client.d.ts +10 -5
- package/api/resources/jobs/client/Client.js +92 -47
- package/api/resources/messages/client/Client.d.ts +2 -1
- package/api/resources/messages/client/Client.js +19 -10
- package/api/resources/models/client/Client.d.ts +2 -1
- package/api/resources/models/client/Client.js +27 -14
- package/api/resources/projects/client/Client.d.ts +2 -1
- package/api/resources/projects/client/Client.js +18 -9
- package/api/resources/providers/client/Client.d.ts +10 -5
- package/api/resources/providers/client/Client.js +77 -36
- package/api/resources/runs/client/Client.d.ts +8 -4
- package/api/resources/runs/client/Client.js +74 -38
- package/api/resources/runs/resources/messages/client/Client.d.ts +2 -1
- package/api/resources/runs/resources/messages/client/Client.js +21 -12
- package/api/resources/runs/resources/steps/client/Client.d.ts +2 -1
- package/api/resources/runs/resources/steps/client/Client.js +19 -10
- package/api/resources/runs/resources/usage/client/Client.d.ts +2 -1
- package/api/resources/runs/resources/usage/client/Client.js +18 -9
- package/api/resources/sources/client/Client.d.ts +20 -10
- package/api/resources/sources/client/Client.js +173 -86
- package/api/resources/sources/resources/files/client/Client.d.ts +6 -3
- package/api/resources/sources/resources/files/client/Client.js +48 -24
- package/api/resources/sources/resources/passages/client/Client.d.ts +2 -1
- package/api/resources/sources/resources/passages/client/Client.js +19 -10
- package/api/resources/steps/client/Client.d.ts +4 -2
- package/api/resources/steps/client/Client.js +41 -21
- package/api/resources/steps/resources/feedback/client/Client.d.ts +2 -1
- package/api/resources/steps/resources/feedback/client/Client.js +23 -12
- package/api/resources/tags/client/Client.d.ts +2 -1
- package/api/resources/tags/client/Client.js +19 -10
- package/api/resources/telemetry/client/Client.d.ts +2 -1
- package/api/resources/telemetry/client/Client.js +18 -9
- package/api/resources/templates/client/Client.d.ts +2 -1
- package/api/resources/templates/client/Client.js +18 -9
- package/api/resources/templates/resources/agents/client/Client.d.ts +2 -1
- package/api/resources/templates/resources/agents/client/Client.js +19 -10
- package/api/resources/tools/client/Client.d.ts +40 -20
- package/api/resources/tools/client/Client.js +356 -182
- package/api/resources/voice/client/Client.d.ts +2 -1
- package/api/resources/voice/client/Client.js +9 -3
- package/api/types/LettaStreamingRequest.d.ts +2 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/Fetcher.js +11 -3
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/getRequestBody.js +2 -1
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/core/fetcher/requestWithRetries.js +1 -1
- package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/core/form-data-utils/FormDataWrapper.js +53 -10
- package/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
- package/core/form-data-utils/encodeAsFormParameter.js +18 -0
- package/core/form-data-utils/index.d.ts +1 -0
- package/core/form-data-utils/index.js +3 -0
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/schemas/Schema.d.ts +2 -0
- package/core/schemas/Schema.js +2 -0
- package/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/core/schemas/builders/bigint/bigint.js +21 -17
- package/core/schemas/builders/object/object.js +1 -0
- package/core/schemas/builders/record/record.js +1 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +64 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +1 -1
- package/dist/api/errors/BadRequestError.d.ts +2 -1
- package/dist/api/errors/BadRequestError.js +2 -1
- package/dist/api/errors/ConflictError.d.ts +2 -1
- package/dist/api/errors/ConflictError.js +2 -1
- package/dist/api/errors/InternalServerError.d.ts +2 -1
- package/dist/api/errors/InternalServerError.js +2 -1
- package/dist/api/errors/NotFoundError.d.ts +2 -1
- package/dist/api/errors/NotFoundError.js +2 -1
- package/dist/api/errors/PaymentRequiredError.d.ts +2 -1
- package/dist/api/errors/PaymentRequiredError.js +2 -1
- package/dist/api/errors/UnprocessableEntityError.d.ts +2 -1
- package/dist/api/errors/UnprocessableEntityError.js +2 -1
- package/dist/api/resources/agents/client/Client.d.ts +20 -10
- package/dist/api/resources/agents/client/Client.js +166 -82
- package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +10 -5
- package/dist/api/resources/agents/resources/blocks/client/Client.js +90 -45
- package/dist/api/resources/agents/resources/context/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/context/client/Client.js +18 -9
- package/dist/api/resources/agents/resources/coreMemory/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +18 -9
- package/dist/api/resources/agents/resources/files/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/files/client/Client.js +45 -21
- package/dist/api/resources/agents/resources/folders/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/folders/client/Client.js +54 -27
- package/dist/api/resources/agents/resources/groups/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/groups/client/Client.js +19 -10
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.d.ts +2 -1
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +18 -9
- package/dist/api/resources/agents/resources/messages/client/Client.d.ts +16 -8
- package/dist/api/resources/agents/resources/messages/client/Client.js +155 -83
- package/dist/api/resources/agents/resources/passages/client/Client.d.ts +8 -4
- package/dist/api/resources/agents/resources/passages/client/Client.js +64 -31
- package/dist/api/resources/agents/resources/sources/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/sources/client/Client.js +54 -27
- package/dist/api/resources/agents/resources/templates/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/templates/client/Client.js +54 -27
- package/dist/api/resources/agents/resources/tools/client/Client.d.ts +6 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +54 -27
- package/dist/api/resources/batches/client/Client.d.ts +8 -4
- package/dist/api/resources/batches/client/Client.js +63 -30
- package/dist/api/resources/blocks/client/Client.d.ts +12 -6
- package/dist/api/resources/blocks/client/Client.js +100 -49
- package/dist/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
- package/dist/api/resources/blocks/resources/agents/client/Client.js +19 -10
- package/dist/api/resources/clientSideAccessTokens/client/Client.d.ts +6 -3
- package/dist/api/resources/clientSideAccessTokens/client/Client.js +46 -22
- package/dist/api/resources/embeddingModels/client/Client.d.ts +2 -1
- package/dist/api/resources/embeddingModels/client/Client.js +18 -9
- package/dist/api/resources/folders/client/Client.d.ts +18 -9
- package/dist/api/resources/folders/client/Client.js +154 -76
- package/dist/api/resources/folders/resources/files/client/Client.d.ts +6 -3
- package/dist/api/resources/folders/resources/files/client/Client.js +48 -24
- package/dist/api/resources/folders/resources/passages/client/Client.d.ts +2 -1
- package/dist/api/resources/folders/resources/passages/client/Client.js +19 -10
- package/dist/api/resources/groups/client/Client.d.ts +12 -6
- package/dist/api/resources/groups/client/Client.js +105 -52
- package/dist/api/resources/groups/resources/messages/client/Client.d.ts +10 -5
- package/dist/api/resources/groups/resources/messages/client/Client.js +91 -49
- package/dist/api/resources/health/client/Client.d.ts +2 -1
- package/dist/api/resources/health/client/Client.js +17 -8
- package/dist/api/resources/identities/client/Client.d.ts +14 -7
- package/dist/api/resources/identities/client/Client.js +123 -61
- package/dist/api/resources/identities/resources/properties/client/Client.d.ts +2 -1
- package/dist/api/resources/identities/resources/properties/client/Client.js +9 -3
- package/dist/api/resources/jobs/client/Client.d.ts +10 -5
- package/dist/api/resources/jobs/client/Client.js +92 -47
- package/dist/api/resources/messages/client/Client.d.ts +2 -1
- package/dist/api/resources/messages/client/Client.js +19 -10
- package/dist/api/resources/models/client/Client.d.ts +2 -1
- package/dist/api/resources/models/client/Client.js +27 -14
- package/dist/api/resources/projects/client/Client.d.ts +2 -1
- package/dist/api/resources/projects/client/Client.js +18 -9
- package/dist/api/resources/providers/client/Client.d.ts +10 -5
- package/dist/api/resources/providers/client/Client.js +77 -36
- package/dist/api/resources/runs/client/Client.d.ts +8 -4
- package/dist/api/resources/runs/client/Client.js +74 -38
- package/dist/api/resources/runs/resources/messages/client/Client.d.ts +2 -1
- package/dist/api/resources/runs/resources/messages/client/Client.js +21 -12
- package/dist/api/resources/runs/resources/steps/client/Client.d.ts +2 -1
- package/dist/api/resources/runs/resources/steps/client/Client.js +19 -10
- package/dist/api/resources/runs/resources/usage/client/Client.d.ts +2 -1
- package/dist/api/resources/runs/resources/usage/client/Client.js +18 -9
- package/dist/api/resources/sources/client/Client.d.ts +20 -10
- package/dist/api/resources/sources/client/Client.js +173 -86
- package/dist/api/resources/sources/resources/files/client/Client.d.ts +6 -3
- package/dist/api/resources/sources/resources/files/client/Client.js +48 -24
- package/dist/api/resources/sources/resources/passages/client/Client.d.ts +2 -1
- package/dist/api/resources/sources/resources/passages/client/Client.js +19 -10
- package/dist/api/resources/steps/client/Client.d.ts +4 -2
- package/dist/api/resources/steps/client/Client.js +41 -21
- package/dist/api/resources/steps/resources/feedback/client/Client.d.ts +2 -1
- package/dist/api/resources/steps/resources/feedback/client/Client.js +23 -12
- package/dist/api/resources/tags/client/Client.d.ts +2 -1
- package/dist/api/resources/tags/client/Client.js +19 -10
- package/dist/api/resources/telemetry/client/Client.d.ts +2 -1
- package/dist/api/resources/telemetry/client/Client.js +18 -9
- package/dist/api/resources/templates/client/Client.d.ts +2 -1
- package/dist/api/resources/templates/client/Client.js +18 -9
- package/dist/api/resources/templates/resources/agents/client/Client.d.ts +2 -1
- package/dist/api/resources/templates/resources/agents/client/Client.js +19 -10
- package/dist/api/resources/tools/client/Client.d.ts +40 -20
- package/dist/api/resources/tools/client/Client.js +356 -182
- package/dist/api/resources/voice/client/Client.d.ts +2 -1
- package/dist/api/resources/voice/client/Client.js +9 -3
- package/dist/api/types/LettaStreamingRequest.d.ts +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.js +11 -3
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/getRequestBody.js +2 -1
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/fetcher/requestWithRetries.js +1 -1
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +53 -10
- package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.js +18 -0
- package/dist/core/form-data-utils/index.d.ts +1 -0
- package/dist/core/form-data-utils/index.js +3 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/schemas/Schema.d.ts +2 -0
- package/dist/core/schemas/Schema.js +2 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/dist/core/schemas/builders/bigint/bigint.js +21 -17
- package/dist/core/schemas/builders/object/object.js +1 -0
- package/dist/core/schemas/builders/record/record.js +1 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +64 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +1 -1
- package/dist/errors/LettaError.d.ts +4 -1
- package/dist/errors/LettaError.js +6 -8
- package/dist/serialization/types/LettaStreamingRequest.d.ts +1 -0
- package/dist/serialization/types/LettaStreamingRequest.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/errors/LettaError.d.ts +4 -1
- package/errors/LettaError.js +6 -8
- package/package.json +4 -4
- package/serialization/types/LettaStreamingRequest.d.ts +1 -0
- package/serialization/types/LettaStreamingRequest.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -74,6 +74,9 @@ class Files {
|
|
|
74
74
|
* await client.agents.files.closeAll("agent_id")
|
|
75
75
|
*/
|
|
76
76
|
closeAll(agentId, requestOptions) {
|
|
77
|
+
return core.HttpResponsePromise.fromPromise(this.__closeAll(agentId, requestOptions));
|
|
78
|
+
}
|
|
79
|
+
__closeAll(agentId, requestOptions) {
|
|
77
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
81
|
var _a, _b, _c;
|
|
79
82
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -81,7 +84,7 @@ class Files {
|
|
|
81
84
|
method: "PATCH",
|
|
82
85
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
83
86
|
? yield core.Supplier.get(this._options.project)
|
|
84
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
87
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
85
88
|
contentType: "application/json",
|
|
86
89
|
requestType: "json",
|
|
87
90
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -89,13 +92,16 @@ class Files {
|
|
|
89
92
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
93
|
});
|
|
91
94
|
if (_response.ok) {
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
return {
|
|
96
|
+
data: serializers.agents.files.closeAll.Response.parseOrThrow(_response.body, {
|
|
97
|
+
unrecognizedObjectKeys: "passthrough",
|
|
98
|
+
allowUnrecognizedUnionMembers: true,
|
|
99
|
+
allowUnrecognizedEnumValues: true,
|
|
100
|
+
skipValidation: true,
|
|
101
|
+
breadcrumbsPrefix: ["response"],
|
|
102
|
+
}),
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
};
|
|
99
105
|
}
|
|
100
106
|
if (_response.error.reason === "status-code") {
|
|
101
107
|
switch (_response.error.statusCode) {
|
|
@@ -106,11 +112,12 @@ class Files {
|
|
|
106
112
|
allowUnrecognizedEnumValues: true,
|
|
107
113
|
skipValidation: true,
|
|
108
114
|
breadcrumbsPrefix: ["response"],
|
|
109
|
-
}));
|
|
115
|
+
}), _response.rawResponse);
|
|
110
116
|
default:
|
|
111
117
|
throw new errors.LettaError({
|
|
112
118
|
statusCode: _response.error.statusCode,
|
|
113
119
|
body: _response.error.body,
|
|
120
|
+
rawResponse: _response.rawResponse,
|
|
114
121
|
});
|
|
115
122
|
}
|
|
116
123
|
}
|
|
@@ -119,12 +126,14 @@ class Files {
|
|
|
119
126
|
throw new errors.LettaError({
|
|
120
127
|
statusCode: _response.error.statusCode,
|
|
121
128
|
body: _response.error.rawBody,
|
|
129
|
+
rawResponse: _response.rawResponse,
|
|
122
130
|
});
|
|
123
131
|
case "timeout":
|
|
124
132
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/close-all.");
|
|
125
133
|
case "unknown":
|
|
126
134
|
throw new errors.LettaError({
|
|
127
135
|
message: _response.error.errorMessage,
|
|
136
|
+
rawResponse: _response.rawResponse,
|
|
128
137
|
});
|
|
129
138
|
}
|
|
130
139
|
});
|
|
@@ -146,6 +155,9 @@ class Files {
|
|
|
146
155
|
* await client.agents.files.open("agent_id", "file_id")
|
|
147
156
|
*/
|
|
148
157
|
open(agentId, fileId, requestOptions) {
|
|
158
|
+
return core.HttpResponsePromise.fromPromise(this.__open(agentId, fileId, requestOptions));
|
|
159
|
+
}
|
|
160
|
+
__open(agentId, fileId, requestOptions) {
|
|
149
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
162
|
var _a, _b, _c;
|
|
151
163
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -153,7 +165,7 @@ class Files {
|
|
|
153
165
|
method: "PATCH",
|
|
154
166
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
155
167
|
? yield core.Supplier.get(this._options.project)
|
|
156
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
168
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
157
169
|
contentType: "application/json",
|
|
158
170
|
requestType: "json",
|
|
159
171
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -161,13 +173,16 @@ class Files {
|
|
|
161
173
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
162
174
|
});
|
|
163
175
|
if (_response.ok) {
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
return {
|
|
177
|
+
data: serializers.agents.files.open.Response.parseOrThrow(_response.body, {
|
|
178
|
+
unrecognizedObjectKeys: "passthrough",
|
|
179
|
+
allowUnrecognizedUnionMembers: true,
|
|
180
|
+
allowUnrecognizedEnumValues: true,
|
|
181
|
+
skipValidation: true,
|
|
182
|
+
breadcrumbsPrefix: ["response"],
|
|
183
|
+
}),
|
|
184
|
+
rawResponse: _response.rawResponse,
|
|
185
|
+
};
|
|
171
186
|
}
|
|
172
187
|
if (_response.error.reason === "status-code") {
|
|
173
188
|
switch (_response.error.statusCode) {
|
|
@@ -178,11 +193,12 @@ class Files {
|
|
|
178
193
|
allowUnrecognizedEnumValues: true,
|
|
179
194
|
skipValidation: true,
|
|
180
195
|
breadcrumbsPrefix: ["response"],
|
|
181
|
-
}));
|
|
196
|
+
}), _response.rawResponse);
|
|
182
197
|
default:
|
|
183
198
|
throw new errors.LettaError({
|
|
184
199
|
statusCode: _response.error.statusCode,
|
|
185
200
|
body: _response.error.body,
|
|
201
|
+
rawResponse: _response.rawResponse,
|
|
186
202
|
});
|
|
187
203
|
}
|
|
188
204
|
}
|
|
@@ -191,12 +207,14 @@ class Files {
|
|
|
191
207
|
throw new errors.LettaError({
|
|
192
208
|
statusCode: _response.error.statusCode,
|
|
193
209
|
body: _response.error.rawBody,
|
|
210
|
+
rawResponse: _response.rawResponse,
|
|
194
211
|
});
|
|
195
212
|
case "timeout":
|
|
196
213
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/open.");
|
|
197
214
|
case "unknown":
|
|
198
215
|
throw new errors.LettaError({
|
|
199
216
|
message: _response.error.errorMessage,
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
200
218
|
});
|
|
201
219
|
}
|
|
202
220
|
});
|
|
@@ -217,6 +235,9 @@ class Files {
|
|
|
217
235
|
* await client.agents.files.close("agent_id", "file_id")
|
|
218
236
|
*/
|
|
219
237
|
close(agentId, fileId, requestOptions) {
|
|
238
|
+
return core.HttpResponsePromise.fromPromise(this.__close(agentId, fileId, requestOptions));
|
|
239
|
+
}
|
|
240
|
+
__close(agentId, fileId, requestOptions) {
|
|
220
241
|
return __awaiter(this, void 0, void 0, function* () {
|
|
221
242
|
var _a, _b, _c;
|
|
222
243
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -224,7 +245,7 @@ class Files {
|
|
|
224
245
|
method: "PATCH",
|
|
225
246
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
226
247
|
? yield core.Supplier.get(this._options.project)
|
|
227
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
248
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
228
249
|
contentType: "application/json",
|
|
229
250
|
requestType: "json",
|
|
230
251
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -232,7 +253,7 @@ class Files {
|
|
|
232
253
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
233
254
|
});
|
|
234
255
|
if (_response.ok) {
|
|
235
|
-
return _response.body;
|
|
256
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
236
257
|
}
|
|
237
258
|
if (_response.error.reason === "status-code") {
|
|
238
259
|
switch (_response.error.statusCode) {
|
|
@@ -243,11 +264,12 @@ class Files {
|
|
|
243
264
|
allowUnrecognizedEnumValues: true,
|
|
244
265
|
skipValidation: true,
|
|
245
266
|
breadcrumbsPrefix: ["response"],
|
|
246
|
-
}));
|
|
267
|
+
}), _response.rawResponse);
|
|
247
268
|
default:
|
|
248
269
|
throw new errors.LettaError({
|
|
249
270
|
statusCode: _response.error.statusCode,
|
|
250
271
|
body: _response.error.body,
|
|
272
|
+
rawResponse: _response.rawResponse,
|
|
251
273
|
});
|
|
252
274
|
}
|
|
253
275
|
}
|
|
@@ -256,12 +278,14 @@ class Files {
|
|
|
256
278
|
throw new errors.LettaError({
|
|
257
279
|
statusCode: _response.error.statusCode,
|
|
258
280
|
body: _response.error.rawBody,
|
|
281
|
+
rawResponse: _response.rawResponse,
|
|
259
282
|
});
|
|
260
283
|
case "timeout":
|
|
261
284
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/files/{file_id}/close.");
|
|
262
285
|
case "unknown":
|
|
263
286
|
throw new errors.LettaError({
|
|
264
287
|
message: _response.error.errorMessage,
|
|
288
|
+
rawResponse: _response.rawResponse,
|
|
265
289
|
});
|
|
266
290
|
}
|
|
267
291
|
});
|
|
@@ -42,7 +42,8 @@ export declare class Folders {
|
|
|
42
42
|
* @example
|
|
43
43
|
* await client.agents.folders.attach("agent_id", "folder_id")
|
|
44
44
|
*/
|
|
45
|
-
attach(agentId: string, folderId: string, requestOptions?: Folders.RequestOptions):
|
|
45
|
+
attach(agentId: string, folderId: string, requestOptions?: Folders.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
46
|
+
private __attach;
|
|
46
47
|
/**
|
|
47
48
|
* Detach a folder from an agent.
|
|
48
49
|
*
|
|
@@ -55,7 +56,8 @@ export declare class Folders {
|
|
|
55
56
|
* @example
|
|
56
57
|
* await client.agents.folders.detach("agent_id", "folder_id")
|
|
57
58
|
*/
|
|
58
|
-
detach(agentId: string, folderId: string, requestOptions?: Folders.RequestOptions):
|
|
59
|
+
detach(agentId: string, folderId: string, requestOptions?: Folders.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
60
|
+
private __detach;
|
|
59
61
|
/**
|
|
60
62
|
* Get the folders associated with an agent.
|
|
61
63
|
*
|
|
@@ -67,7 +69,8 @@ export declare class Folders {
|
|
|
67
69
|
* @example
|
|
68
70
|
* await client.agents.folders.list("agent_id")
|
|
69
71
|
*/
|
|
70
|
-
list(agentId: string, requestOptions?: Folders.RequestOptions):
|
|
72
|
+
list(agentId: string, requestOptions?: Folders.RequestOptions): core.HttpResponsePromise<Letta.Source[]>;
|
|
73
|
+
private __list;
|
|
71
74
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
72
75
|
Authorization: string;
|
|
73
76
|
}>;
|
|
@@ -72,6 +72,9 @@ class Folders {
|
|
|
72
72
|
* await client.agents.folders.attach("agent_id", "folder_id")
|
|
73
73
|
*/
|
|
74
74
|
attach(agentId, folderId, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__attach(agentId, folderId, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__attach(agentId, folderId, requestOptions) {
|
|
75
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
79
|
var _a, _b, _c;
|
|
77
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -79,7 +82,7 @@ class Folders {
|
|
|
79
82
|
method: "PATCH",
|
|
80
83
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
84
|
? yield core.Supplier.get(this._options.project)
|
|
82
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
83
86
|
contentType: "application/json",
|
|
84
87
|
requestType: "json",
|
|
85
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -87,13 +90,16 @@ class Folders {
|
|
|
87
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
91
|
});
|
|
89
92
|
if (_response.ok) {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
return {
|
|
94
|
+
data: serializers.AgentState.parseOrThrow(_response.body, {
|
|
95
|
+
unrecognizedObjectKeys: "passthrough",
|
|
96
|
+
allowUnrecognizedUnionMembers: true,
|
|
97
|
+
allowUnrecognizedEnumValues: true,
|
|
98
|
+
skipValidation: true,
|
|
99
|
+
breadcrumbsPrefix: ["response"],
|
|
100
|
+
}),
|
|
101
|
+
rawResponse: _response.rawResponse,
|
|
102
|
+
};
|
|
97
103
|
}
|
|
98
104
|
if (_response.error.reason === "status-code") {
|
|
99
105
|
switch (_response.error.statusCode) {
|
|
@@ -104,11 +110,12 @@ class Folders {
|
|
|
104
110
|
allowUnrecognizedEnumValues: true,
|
|
105
111
|
skipValidation: true,
|
|
106
112
|
breadcrumbsPrefix: ["response"],
|
|
107
|
-
}));
|
|
113
|
+
}), _response.rawResponse);
|
|
108
114
|
default:
|
|
109
115
|
throw new errors.LettaError({
|
|
110
116
|
statusCode: _response.error.statusCode,
|
|
111
117
|
body: _response.error.body,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
112
119
|
});
|
|
113
120
|
}
|
|
114
121
|
}
|
|
@@ -117,12 +124,14 @@ class Folders {
|
|
|
117
124
|
throw new errors.LettaError({
|
|
118
125
|
statusCode: _response.error.statusCode,
|
|
119
126
|
body: _response.error.rawBody,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
120
128
|
});
|
|
121
129
|
case "timeout":
|
|
122
130
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/folders/attach/{folder_id}.");
|
|
123
131
|
case "unknown":
|
|
124
132
|
throw new errors.LettaError({
|
|
125
133
|
message: _response.error.errorMessage,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
126
135
|
});
|
|
127
136
|
}
|
|
128
137
|
});
|
|
@@ -140,6 +149,9 @@ class Folders {
|
|
|
140
149
|
* await client.agents.folders.detach("agent_id", "folder_id")
|
|
141
150
|
*/
|
|
142
151
|
detach(agentId, folderId, requestOptions) {
|
|
152
|
+
return core.HttpResponsePromise.fromPromise(this.__detach(agentId, folderId, requestOptions));
|
|
153
|
+
}
|
|
154
|
+
__detach(agentId, folderId, requestOptions) {
|
|
143
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
156
|
var _a, _b, _c;
|
|
145
157
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -147,7 +159,7 @@ class Folders {
|
|
|
147
159
|
method: "PATCH",
|
|
148
160
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
149
161
|
? yield core.Supplier.get(this._options.project)
|
|
150
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
162
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
151
163
|
contentType: "application/json",
|
|
152
164
|
requestType: "json",
|
|
153
165
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -155,13 +167,16 @@ class Folders {
|
|
|
155
167
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
156
168
|
});
|
|
157
169
|
if (_response.ok) {
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
return {
|
|
171
|
+
data: serializers.AgentState.parseOrThrow(_response.body, {
|
|
172
|
+
unrecognizedObjectKeys: "passthrough",
|
|
173
|
+
allowUnrecognizedUnionMembers: true,
|
|
174
|
+
allowUnrecognizedEnumValues: true,
|
|
175
|
+
skipValidation: true,
|
|
176
|
+
breadcrumbsPrefix: ["response"],
|
|
177
|
+
}),
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
};
|
|
165
180
|
}
|
|
166
181
|
if (_response.error.reason === "status-code") {
|
|
167
182
|
switch (_response.error.statusCode) {
|
|
@@ -172,11 +187,12 @@ class Folders {
|
|
|
172
187
|
allowUnrecognizedEnumValues: true,
|
|
173
188
|
skipValidation: true,
|
|
174
189
|
breadcrumbsPrefix: ["response"],
|
|
175
|
-
}));
|
|
190
|
+
}), _response.rawResponse);
|
|
176
191
|
default:
|
|
177
192
|
throw new errors.LettaError({
|
|
178
193
|
statusCode: _response.error.statusCode,
|
|
179
194
|
body: _response.error.body,
|
|
195
|
+
rawResponse: _response.rawResponse,
|
|
180
196
|
});
|
|
181
197
|
}
|
|
182
198
|
}
|
|
@@ -185,12 +201,14 @@ class Folders {
|
|
|
185
201
|
throw new errors.LettaError({
|
|
186
202
|
statusCode: _response.error.statusCode,
|
|
187
203
|
body: _response.error.rawBody,
|
|
204
|
+
rawResponse: _response.rawResponse,
|
|
188
205
|
});
|
|
189
206
|
case "timeout":
|
|
190
207
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/folders/detach/{folder_id}.");
|
|
191
208
|
case "unknown":
|
|
192
209
|
throw new errors.LettaError({
|
|
193
210
|
message: _response.error.errorMessage,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
194
212
|
});
|
|
195
213
|
}
|
|
196
214
|
});
|
|
@@ -207,6 +225,9 @@ class Folders {
|
|
|
207
225
|
* await client.agents.folders.list("agent_id")
|
|
208
226
|
*/
|
|
209
227
|
list(agentId, requestOptions) {
|
|
228
|
+
return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions));
|
|
229
|
+
}
|
|
230
|
+
__list(agentId, requestOptions) {
|
|
210
231
|
return __awaiter(this, void 0, void 0, function* () {
|
|
211
232
|
var _a, _b, _c;
|
|
212
233
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -214,7 +235,7 @@ class Folders {
|
|
|
214
235
|
method: "GET",
|
|
215
236
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
216
237
|
? yield core.Supplier.get(this._options.project)
|
|
217
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
238
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
218
239
|
contentType: "application/json",
|
|
219
240
|
requestType: "json",
|
|
220
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -222,13 +243,16 @@ class Folders {
|
|
|
222
243
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
223
244
|
});
|
|
224
245
|
if (_response.ok) {
|
|
225
|
-
return
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
246
|
+
return {
|
|
247
|
+
data: serializers.agents.folders.list.Response.parseOrThrow(_response.body, {
|
|
248
|
+
unrecognizedObjectKeys: "passthrough",
|
|
249
|
+
allowUnrecognizedUnionMembers: true,
|
|
250
|
+
allowUnrecognizedEnumValues: true,
|
|
251
|
+
skipValidation: true,
|
|
252
|
+
breadcrumbsPrefix: ["response"],
|
|
253
|
+
}),
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
};
|
|
232
256
|
}
|
|
233
257
|
if (_response.error.reason === "status-code") {
|
|
234
258
|
switch (_response.error.statusCode) {
|
|
@@ -239,11 +263,12 @@ class Folders {
|
|
|
239
263
|
allowUnrecognizedEnumValues: true,
|
|
240
264
|
skipValidation: true,
|
|
241
265
|
breadcrumbsPrefix: ["response"],
|
|
242
|
-
}));
|
|
266
|
+
}), _response.rawResponse);
|
|
243
267
|
default:
|
|
244
268
|
throw new errors.LettaError({
|
|
245
269
|
statusCode: _response.error.statusCode,
|
|
246
270
|
body: _response.error.body,
|
|
271
|
+
rawResponse: _response.rawResponse,
|
|
247
272
|
});
|
|
248
273
|
}
|
|
249
274
|
}
|
|
@@ -252,12 +277,14 @@ class Folders {
|
|
|
252
277
|
throw new errors.LettaError({
|
|
253
278
|
statusCode: _response.error.statusCode,
|
|
254
279
|
body: _response.error.rawBody,
|
|
280
|
+
rawResponse: _response.rawResponse,
|
|
255
281
|
});
|
|
256
282
|
case "timeout":
|
|
257
283
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/folders.");
|
|
258
284
|
case "unknown":
|
|
259
285
|
throw new errors.LettaError({
|
|
260
286
|
message: _response.error.errorMessage,
|
|
287
|
+
rawResponse: _response.rawResponse,
|
|
261
288
|
});
|
|
262
289
|
}
|
|
263
290
|
});
|
|
@@ -42,7 +42,8 @@ export declare class Groups {
|
|
|
42
42
|
* @example
|
|
43
43
|
* await client.agents.groups.list("agent_id")
|
|
44
44
|
*/
|
|
45
|
-
list(agentId: string, request?: Letta.agents.GroupsListRequest, requestOptions?: Groups.RequestOptions):
|
|
45
|
+
list(agentId: string, request?: Letta.agents.GroupsListRequest, requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<Letta.Group[]>;
|
|
46
|
+
private __list;
|
|
46
47
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
47
48
|
Authorization: string;
|
|
48
49
|
}>;
|
|
@@ -71,7 +71,10 @@ class Groups {
|
|
|
71
71
|
* @example
|
|
72
72
|
* await client.agents.groups.list("agent_id")
|
|
73
73
|
*/
|
|
74
|
-
list(
|
|
74
|
+
list(agentId, request = {}, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__list(agentId, request, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__list(agentId_1) {
|
|
75
78
|
return __awaiter(this, arguments, void 0, function* (agentId, request = {}, requestOptions) {
|
|
76
79
|
var _a, _b, _c;
|
|
77
80
|
const { managerType } = request;
|
|
@@ -84,7 +87,7 @@ class Groups {
|
|
|
84
87
|
method: "GET",
|
|
85
88
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
86
89
|
? yield core.Supplier.get(this._options.project)
|
|
87
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
90
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
88
91
|
contentType: "application/json",
|
|
89
92
|
queryParameters: _queryParams,
|
|
90
93
|
requestType: "json",
|
|
@@ -93,13 +96,16 @@ class Groups {
|
|
|
93
96
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
94
97
|
});
|
|
95
98
|
if (_response.ok) {
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
return {
|
|
100
|
+
data: serializers.agents.groups.list.Response.parseOrThrow(_response.body, {
|
|
101
|
+
unrecognizedObjectKeys: "passthrough",
|
|
102
|
+
allowUnrecognizedUnionMembers: true,
|
|
103
|
+
allowUnrecognizedEnumValues: true,
|
|
104
|
+
skipValidation: true,
|
|
105
|
+
breadcrumbsPrefix: ["response"],
|
|
106
|
+
}),
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
};
|
|
103
109
|
}
|
|
104
110
|
if (_response.error.reason === "status-code") {
|
|
105
111
|
switch (_response.error.statusCode) {
|
|
@@ -110,11 +116,12 @@ class Groups {
|
|
|
110
116
|
allowUnrecognizedEnumValues: true,
|
|
111
117
|
skipValidation: true,
|
|
112
118
|
breadcrumbsPrefix: ["response"],
|
|
113
|
-
}));
|
|
119
|
+
}), _response.rawResponse);
|
|
114
120
|
default:
|
|
115
121
|
throw new errors.LettaError({
|
|
116
122
|
statusCode: _response.error.statusCode,
|
|
117
123
|
body: _response.error.body,
|
|
124
|
+
rawResponse: _response.rawResponse,
|
|
118
125
|
});
|
|
119
126
|
}
|
|
120
127
|
}
|
|
@@ -123,12 +130,14 @@ class Groups {
|
|
|
123
130
|
throw new errors.LettaError({
|
|
124
131
|
statusCode: _response.error.statusCode,
|
|
125
132
|
body: _response.error.rawBody,
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
126
134
|
});
|
|
127
135
|
case "timeout":
|
|
128
136
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/groups.");
|
|
129
137
|
case "unknown":
|
|
130
138
|
throw new errors.LettaError({
|
|
131
139
|
message: _response.error.errorMessage,
|
|
140
|
+
rawResponse: _response.rawResponse,
|
|
132
141
|
});
|
|
133
142
|
}
|
|
134
143
|
});
|
|
@@ -43,7 +43,8 @@ export declare class MemoryVariables {
|
|
|
43
43
|
* @example
|
|
44
44
|
* await client.agents.memoryVariables.list("agent_id")
|
|
45
45
|
*/
|
|
46
|
-
list(agentId: string, requestOptions?: MemoryVariables.RequestOptions):
|
|
46
|
+
list(agentId: string, requestOptions?: MemoryVariables.RequestOptions): core.HttpResponsePromise<Letta.agents.MemoryVariablesListResponse>;
|
|
47
|
+
private __list;
|
|
47
48
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
48
49
|
Authorization: string;
|
|
49
50
|
}>;
|
|
@@ -73,6 +73,9 @@ class MemoryVariables {
|
|
|
73
73
|
* await client.agents.memoryVariables.list("agent_id")
|
|
74
74
|
*/
|
|
75
75
|
list(agentId, requestOptions) {
|
|
76
|
+
return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions));
|
|
77
|
+
}
|
|
78
|
+
__list(agentId, requestOptions) {
|
|
76
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
80
|
var _a, _b, _c;
|
|
78
81
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -80,7 +83,7 @@ class MemoryVariables {
|
|
|
80
83
|
method: "GET",
|
|
81
84
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
82
85
|
? yield core.Supplier.get(this._options.project)
|
|
83
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
86
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "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),
|
|
84
87
|
contentType: "application/json",
|
|
85
88
|
requestType: "json",
|
|
86
89
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -88,22 +91,26 @@ class MemoryVariables {
|
|
|
88
91
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
89
92
|
});
|
|
90
93
|
if (_response.ok) {
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
return {
|
|
95
|
+
data: serializers.agents.MemoryVariablesListResponse.parseOrThrow(_response.body, {
|
|
96
|
+
unrecognizedObjectKeys: "passthrough",
|
|
97
|
+
allowUnrecognizedUnionMembers: true,
|
|
98
|
+
allowUnrecognizedEnumValues: true,
|
|
99
|
+
skipValidation: true,
|
|
100
|
+
breadcrumbsPrefix: ["response"],
|
|
101
|
+
}),
|
|
102
|
+
rawResponse: _response.rawResponse,
|
|
103
|
+
};
|
|
98
104
|
}
|
|
99
105
|
if (_response.error.reason === "status-code") {
|
|
100
106
|
switch (_response.error.statusCode) {
|
|
101
107
|
case 404:
|
|
102
|
-
throw new Letta.NotFoundError(_response.error.body);
|
|
108
|
+
throw new Letta.NotFoundError(_response.error.body, _response.rawResponse);
|
|
103
109
|
default:
|
|
104
110
|
throw new errors.LettaError({
|
|
105
111
|
statusCode: _response.error.statusCode,
|
|
106
112
|
body: _response.error.body,
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
107
114
|
});
|
|
108
115
|
}
|
|
109
116
|
}
|
|
@@ -112,12 +119,14 @@ class MemoryVariables {
|
|
|
112
119
|
throw new errors.LettaError({
|
|
113
120
|
statusCode: _response.error.statusCode,
|
|
114
121
|
body: _response.error.rawBody,
|
|
122
|
+
rawResponse: _response.rawResponse,
|
|
115
123
|
});
|
|
116
124
|
case "timeout":
|
|
117
125
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/variables.");
|
|
118
126
|
case "unknown":
|
|
119
127
|
throw new errors.LettaError({
|
|
120
128
|
message: _response.error.errorMessage,
|
|
129
|
+
rawResponse: _response.rawResponse,
|
|
121
130
|
});
|
|
122
131
|
}
|
|
123
132
|
});
|