@letta-ai/letta-client 0.1.169 → 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/api/types/ModalSandboxConfig.d.ts +9 -0
- package/api/types/ModalSandboxConfig.js +5 -0
- package/api/types/SandboxConfigCreateConfig.d.ts +1 -1
- package/api/types/SandboxConfigUpdateConfig.d.ts +1 -1
- package/api/types/SandboxType.d.ts +2 -1
- package/api/types/SandboxType.js +1 -0
- package/api/types/ToolType.d.ts +1 -2
- package/api/types/ToolType.js +0 -1
- package/api/types/index.d.ts +1 -0
- package/api/types/index.js +1 -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/api/types/ModalSandboxConfig.d.ts +9 -0
- package/dist/api/types/ModalSandboxConfig.js +5 -0
- package/dist/api/types/SandboxConfigCreateConfig.d.ts +1 -1
- package/dist/api/types/SandboxConfigUpdateConfig.d.ts +1 -1
- package/dist/api/types/SandboxType.d.ts +2 -1
- package/dist/api/types/SandboxType.js +1 -0
- package/dist/api/types/ToolType.d.ts +1 -2
- package/dist/api/types/ToolType.js +0 -1
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -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/serialization/types/ModalSandboxConfig.d.ts +13 -0
- package/dist/serialization/types/ModalSandboxConfig.js +44 -0
- package/dist/serialization/types/SandboxConfigCreateConfig.d.ts +2 -1
- package/dist/serialization/types/SandboxConfigCreateConfig.js +2 -1
- package/dist/serialization/types/SandboxConfigUpdateConfig.d.ts +2 -1
- package/dist/serialization/types/SandboxConfigUpdateConfig.js +2 -1
- package/dist/serialization/types/SandboxType.d.ts +1 -1
- package/dist/serialization/types/SandboxType.js +1 -1
- package/dist/serialization/types/ToolType.d.ts +1 -1
- package/dist/serialization/types/ToolType.js +0 -1
- package/dist/serialization/types/index.d.ts +1 -0
- package/dist/serialization/types/index.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/serialization/types/ModalSandboxConfig.d.ts +13 -0
- package/serialization/types/ModalSandboxConfig.js +44 -0
- package/serialization/types/SandboxConfigCreateConfig.d.ts +2 -1
- package/serialization/types/SandboxConfigCreateConfig.js +2 -1
- package/serialization/types/SandboxConfigUpdateConfig.d.ts +2 -1
- package/serialization/types/SandboxConfigUpdateConfig.js +2 -1
- package/serialization/types/SandboxType.d.ts +1 -1
- package/serialization/types/SandboxType.js +1 -1
- package/serialization/types/ToolType.d.ts +1 -1
- package/serialization/types/ToolType.js +0 -1
- package/serialization/types/index.d.ts +1 -0
- package/serialization/types/index.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -70,6 +70,9 @@ class Batches {
|
|
|
70
70
|
* await client.batches.list()
|
|
71
71
|
*/
|
|
72
72
|
list(requestOptions) {
|
|
73
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
74
|
+
}
|
|
75
|
+
__list(requestOptions) {
|
|
73
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
77
|
var _a, _b, _c;
|
|
75
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -77,7 +80,7 @@ class Batches {
|
|
|
77
80
|
method: "GET",
|
|
78
81
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
79
82
|
? yield core.Supplier.get(this._options.project)
|
|
80
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
83
|
+
: 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),
|
|
81
84
|
contentType: "application/json",
|
|
82
85
|
requestType: "json",
|
|
83
86
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -85,13 +88,16 @@ class Batches {
|
|
|
85
88
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
89
|
});
|
|
87
90
|
if (_response.ok) {
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
return {
|
|
92
|
+
data: serializers.batches.list.Response.parseOrThrow(_response.body, {
|
|
93
|
+
unrecognizedObjectKeys: "passthrough",
|
|
94
|
+
allowUnrecognizedUnionMembers: true,
|
|
95
|
+
allowUnrecognizedEnumValues: true,
|
|
96
|
+
skipValidation: true,
|
|
97
|
+
breadcrumbsPrefix: ["response"],
|
|
98
|
+
}),
|
|
99
|
+
rawResponse: _response.rawResponse,
|
|
100
|
+
};
|
|
95
101
|
}
|
|
96
102
|
if (_response.error.reason === "status-code") {
|
|
97
103
|
switch (_response.error.statusCode) {
|
|
@@ -102,11 +108,12 @@ class Batches {
|
|
|
102
108
|
allowUnrecognizedEnumValues: true,
|
|
103
109
|
skipValidation: true,
|
|
104
110
|
breadcrumbsPrefix: ["response"],
|
|
105
|
-
}));
|
|
111
|
+
}), _response.rawResponse);
|
|
106
112
|
default:
|
|
107
113
|
throw new errors.LettaError({
|
|
108
114
|
statusCode: _response.error.statusCode,
|
|
109
115
|
body: _response.error.body,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
110
117
|
});
|
|
111
118
|
}
|
|
112
119
|
}
|
|
@@ -115,12 +122,14 @@ class Batches {
|
|
|
115
122
|
throw new errors.LettaError({
|
|
116
123
|
statusCode: _response.error.statusCode,
|
|
117
124
|
body: _response.error.rawBody,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
118
126
|
});
|
|
119
127
|
case "timeout":
|
|
120
128
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/messages/batches.");
|
|
121
129
|
case "unknown":
|
|
122
130
|
throw new errors.LettaError({
|
|
123
131
|
message: _response.error.errorMessage,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
124
133
|
});
|
|
125
134
|
}
|
|
126
135
|
});
|
|
@@ -149,6 +158,9 @@ class Batches {
|
|
|
149
158
|
* })
|
|
150
159
|
*/
|
|
151
160
|
create(request, requestOptions) {
|
|
161
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
162
|
+
}
|
|
163
|
+
__create(request, requestOptions) {
|
|
152
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
165
|
var _a, _b, _c;
|
|
154
166
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -156,7 +168,7 @@ class Batches {
|
|
|
156
168
|
method: "POST",
|
|
157
169
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
158
170
|
? yield core.Supplier.get(this._options.project)
|
|
159
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
171
|
+
: 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),
|
|
160
172
|
contentType: "application/json",
|
|
161
173
|
requestType: "json",
|
|
162
174
|
body: serializers.CreateBatch.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -165,13 +177,16 @@ class Batches {
|
|
|
165
177
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
166
178
|
});
|
|
167
179
|
if (_response.ok) {
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
return {
|
|
181
|
+
data: serializers.BatchJob.parseOrThrow(_response.body, {
|
|
182
|
+
unrecognizedObjectKeys: "passthrough",
|
|
183
|
+
allowUnrecognizedUnionMembers: true,
|
|
184
|
+
allowUnrecognizedEnumValues: true,
|
|
185
|
+
skipValidation: true,
|
|
186
|
+
breadcrumbsPrefix: ["response"],
|
|
187
|
+
}),
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
};
|
|
175
190
|
}
|
|
176
191
|
if (_response.error.reason === "status-code") {
|
|
177
192
|
switch (_response.error.statusCode) {
|
|
@@ -182,11 +197,12 @@ class Batches {
|
|
|
182
197
|
allowUnrecognizedEnumValues: true,
|
|
183
198
|
skipValidation: true,
|
|
184
199
|
breadcrumbsPrefix: ["response"],
|
|
185
|
-
}));
|
|
200
|
+
}), _response.rawResponse);
|
|
186
201
|
default:
|
|
187
202
|
throw new errors.LettaError({
|
|
188
203
|
statusCode: _response.error.statusCode,
|
|
189
204
|
body: _response.error.body,
|
|
205
|
+
rawResponse: _response.rawResponse,
|
|
190
206
|
});
|
|
191
207
|
}
|
|
192
208
|
}
|
|
@@ -195,12 +211,14 @@ class Batches {
|
|
|
195
211
|
throw new errors.LettaError({
|
|
196
212
|
statusCode: _response.error.statusCode,
|
|
197
213
|
body: _response.error.rawBody,
|
|
214
|
+
rawResponse: _response.rawResponse,
|
|
198
215
|
});
|
|
199
216
|
case "timeout":
|
|
200
217
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/messages/batches.");
|
|
201
218
|
case "unknown":
|
|
202
219
|
throw new errors.LettaError({
|
|
203
220
|
message: _response.error.errorMessage,
|
|
221
|
+
rawResponse: _response.rawResponse,
|
|
204
222
|
});
|
|
205
223
|
}
|
|
206
224
|
});
|
|
@@ -217,6 +235,9 @@ class Batches {
|
|
|
217
235
|
* await client.batches.retrieve("batch_id")
|
|
218
236
|
*/
|
|
219
237
|
retrieve(batchId, requestOptions) {
|
|
238
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(batchId, requestOptions));
|
|
239
|
+
}
|
|
240
|
+
__retrieve(batchId, 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 Batches {
|
|
|
224
245
|
method: "GET",
|
|
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,13 +253,16 @@ class Batches {
|
|
|
232
253
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
233
254
|
});
|
|
234
255
|
if (_response.ok) {
|
|
235
|
-
return
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
256
|
+
return {
|
|
257
|
+
data: serializers.BatchJob.parseOrThrow(_response.body, {
|
|
258
|
+
unrecognizedObjectKeys: "passthrough",
|
|
259
|
+
allowUnrecognizedUnionMembers: true,
|
|
260
|
+
allowUnrecognizedEnumValues: true,
|
|
261
|
+
skipValidation: true,
|
|
262
|
+
breadcrumbsPrefix: ["response"],
|
|
263
|
+
}),
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
};
|
|
242
266
|
}
|
|
243
267
|
if (_response.error.reason === "status-code") {
|
|
244
268
|
switch (_response.error.statusCode) {
|
|
@@ -249,11 +273,12 @@ class Batches {
|
|
|
249
273
|
allowUnrecognizedEnumValues: true,
|
|
250
274
|
skipValidation: true,
|
|
251
275
|
breadcrumbsPrefix: ["response"],
|
|
252
|
-
}));
|
|
276
|
+
}), _response.rawResponse);
|
|
253
277
|
default:
|
|
254
278
|
throw new errors.LettaError({
|
|
255
279
|
statusCode: _response.error.statusCode,
|
|
256
280
|
body: _response.error.body,
|
|
281
|
+
rawResponse: _response.rawResponse,
|
|
257
282
|
});
|
|
258
283
|
}
|
|
259
284
|
}
|
|
@@ -262,12 +287,14 @@ class Batches {
|
|
|
262
287
|
throw new errors.LettaError({
|
|
263
288
|
statusCode: _response.error.statusCode,
|
|
264
289
|
body: _response.error.rawBody,
|
|
290
|
+
rawResponse: _response.rawResponse,
|
|
265
291
|
});
|
|
266
292
|
case "timeout":
|
|
267
293
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/messages/batches/{batch_id}.");
|
|
268
294
|
case "unknown":
|
|
269
295
|
throw new errors.LettaError({
|
|
270
296
|
message: _response.error.errorMessage,
|
|
297
|
+
rawResponse: _response.rawResponse,
|
|
271
298
|
});
|
|
272
299
|
}
|
|
273
300
|
});
|
|
@@ -284,6 +311,9 @@ class Batches {
|
|
|
284
311
|
* await client.batches.cancel("batch_id")
|
|
285
312
|
*/
|
|
286
313
|
cancel(batchId, requestOptions) {
|
|
314
|
+
return core.HttpResponsePromise.fromPromise(this.__cancel(batchId, requestOptions));
|
|
315
|
+
}
|
|
316
|
+
__cancel(batchId, requestOptions) {
|
|
287
317
|
return __awaiter(this, void 0, void 0, function* () {
|
|
288
318
|
var _a, _b, _c;
|
|
289
319
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -291,7 +321,7 @@ class Batches {
|
|
|
291
321
|
method: "PATCH",
|
|
292
322
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
293
323
|
? yield core.Supplier.get(this._options.project)
|
|
294
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
324
|
+
: 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),
|
|
295
325
|
contentType: "application/json",
|
|
296
326
|
requestType: "json",
|
|
297
327
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -299,7 +329,7 @@ class Batches {
|
|
|
299
329
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
300
330
|
});
|
|
301
331
|
if (_response.ok) {
|
|
302
|
-
return _response.body;
|
|
332
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
303
333
|
}
|
|
304
334
|
if (_response.error.reason === "status-code") {
|
|
305
335
|
switch (_response.error.statusCode) {
|
|
@@ -310,11 +340,12 @@ class Batches {
|
|
|
310
340
|
allowUnrecognizedEnumValues: true,
|
|
311
341
|
skipValidation: true,
|
|
312
342
|
breadcrumbsPrefix: ["response"],
|
|
313
|
-
}));
|
|
343
|
+
}), _response.rawResponse);
|
|
314
344
|
default:
|
|
315
345
|
throw new errors.LettaError({
|
|
316
346
|
statusCode: _response.error.statusCode,
|
|
317
347
|
body: _response.error.body,
|
|
348
|
+
rawResponse: _response.rawResponse,
|
|
318
349
|
});
|
|
319
350
|
}
|
|
320
351
|
}
|
|
@@ -323,12 +354,14 @@ class Batches {
|
|
|
323
354
|
throw new errors.LettaError({
|
|
324
355
|
statusCode: _response.error.statusCode,
|
|
325
356
|
body: _response.error.rawBody,
|
|
357
|
+
rawResponse: _response.rawResponse,
|
|
326
358
|
});
|
|
327
359
|
case "timeout":
|
|
328
360
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/messages/batches/{batch_id}/cancel.");
|
|
329
361
|
case "unknown":
|
|
330
362
|
throw new errors.LettaError({
|
|
331
363
|
message: _response.error.errorMessage,
|
|
364
|
+
rawResponse: _response.rawResponse,
|
|
332
365
|
});
|
|
333
366
|
}
|
|
334
367
|
});
|
|
@@ -42,7 +42,8 @@ export declare class Blocks {
|
|
|
42
42
|
* @example
|
|
43
43
|
* await client.blocks.list()
|
|
44
44
|
*/
|
|
45
|
-
list(request?: Letta.BlocksListRequest, requestOptions?: Blocks.RequestOptions):
|
|
45
|
+
list(request?: Letta.BlocksListRequest, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block[]>;
|
|
46
|
+
private __list;
|
|
46
47
|
/**
|
|
47
48
|
* @param {Letta.CreateBlock} request
|
|
48
49
|
* @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -55,7 +56,8 @@ export declare class Blocks {
|
|
|
55
56
|
* label: "label"
|
|
56
57
|
* })
|
|
57
58
|
*/
|
|
58
|
-
create(request: Letta.CreateBlock, requestOptions?: Blocks.RequestOptions):
|
|
59
|
+
create(request: Letta.CreateBlock, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block>;
|
|
60
|
+
private __create;
|
|
59
61
|
/**
|
|
60
62
|
* Count all blocks created by a user.
|
|
61
63
|
*
|
|
@@ -66,7 +68,8 @@ export declare class Blocks {
|
|
|
66
68
|
* @example
|
|
67
69
|
* await client.blocks.count()
|
|
68
70
|
*/
|
|
69
|
-
count(requestOptions?: Blocks.RequestOptions):
|
|
71
|
+
count(requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<number>;
|
|
72
|
+
private __count;
|
|
70
73
|
/**
|
|
71
74
|
* @param {string} blockId
|
|
72
75
|
* @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -76,7 +79,8 @@ export declare class Blocks {
|
|
|
76
79
|
* @example
|
|
77
80
|
* await client.blocks.retrieve("block_id")
|
|
78
81
|
*/
|
|
79
|
-
retrieve(blockId: string, requestOptions?: Blocks.RequestOptions):
|
|
82
|
+
retrieve(blockId: string, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block>;
|
|
83
|
+
private __retrieve;
|
|
80
84
|
/**
|
|
81
85
|
* @param {string} blockId
|
|
82
86
|
* @param {Blocks.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -86,7 +90,8 @@ export declare class Blocks {
|
|
|
86
90
|
* @example
|
|
87
91
|
* await client.blocks.delete("block_id")
|
|
88
92
|
*/
|
|
89
|
-
delete(blockId: string, requestOptions?: Blocks.RequestOptions):
|
|
93
|
+
delete(blockId: string, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
94
|
+
private __delete;
|
|
90
95
|
/**
|
|
91
96
|
* @param {string} blockId
|
|
92
97
|
* @param {Letta.BlockUpdate} request
|
|
@@ -97,7 +102,8 @@ export declare class Blocks {
|
|
|
97
102
|
* @example
|
|
98
103
|
* await client.blocks.modify("block_id", {})
|
|
99
104
|
*/
|
|
100
|
-
modify(blockId: string, request: Letta.BlockUpdate, requestOptions?: Blocks.RequestOptions):
|
|
105
|
+
modify(blockId: string, request: Letta.BlockUpdate, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block>;
|
|
106
|
+
private __modify;
|
|
101
107
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
102
108
|
Authorization: string;
|
|
103
109
|
}>;
|