@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
|
@@ -80,6 +80,9 @@ class Sources {
|
|
|
80
80
|
* await client.sources.count()
|
|
81
81
|
*/
|
|
82
82
|
count(requestOptions) {
|
|
83
|
+
return core.HttpResponsePromise.fromPromise(this.__count(requestOptions));
|
|
84
|
+
}
|
|
85
|
+
__count(requestOptions) {
|
|
83
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
87
|
var _a, _b, _c;
|
|
85
88
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -87,7 +90,7 @@ class Sources {
|
|
|
87
90
|
method: "GET",
|
|
88
91
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
89
92
|
? yield core.Supplier.get(this._options.project)
|
|
90
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
93
|
+
: 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),
|
|
91
94
|
contentType: "application/json",
|
|
92
95
|
requestType: "json",
|
|
93
96
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -95,13 +98,16 @@ class Sources {
|
|
|
95
98
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
99
|
});
|
|
97
100
|
if (_response.ok) {
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
return {
|
|
102
|
+
data: serializers.sources.count.Response.parseOrThrow(_response.body, {
|
|
103
|
+
unrecognizedObjectKeys: "passthrough",
|
|
104
|
+
allowUnrecognizedUnionMembers: true,
|
|
105
|
+
allowUnrecognizedEnumValues: true,
|
|
106
|
+
skipValidation: true,
|
|
107
|
+
breadcrumbsPrefix: ["response"],
|
|
108
|
+
}),
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
};
|
|
105
111
|
}
|
|
106
112
|
if (_response.error.reason === "status-code") {
|
|
107
113
|
switch (_response.error.statusCode) {
|
|
@@ -112,11 +118,12 @@ class Sources {
|
|
|
112
118
|
allowUnrecognizedEnumValues: true,
|
|
113
119
|
skipValidation: true,
|
|
114
120
|
breadcrumbsPrefix: ["response"],
|
|
115
|
-
}));
|
|
121
|
+
}), _response.rawResponse);
|
|
116
122
|
default:
|
|
117
123
|
throw new errors.LettaError({
|
|
118
124
|
statusCode: _response.error.statusCode,
|
|
119
125
|
body: _response.error.body,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
120
127
|
});
|
|
121
128
|
}
|
|
122
129
|
}
|
|
@@ -125,12 +132,14 @@ class Sources {
|
|
|
125
132
|
throw new errors.LettaError({
|
|
126
133
|
statusCode: _response.error.statusCode,
|
|
127
134
|
body: _response.error.rawBody,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
128
136
|
});
|
|
129
137
|
case "timeout":
|
|
130
138
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/count.");
|
|
131
139
|
case "unknown":
|
|
132
140
|
throw new errors.LettaError({
|
|
133
141
|
message: _response.error.errorMessage,
|
|
142
|
+
rawResponse: _response.rawResponse,
|
|
134
143
|
});
|
|
135
144
|
}
|
|
136
145
|
});
|
|
@@ -147,6 +156,9 @@ class Sources {
|
|
|
147
156
|
* await client.sources.retrieve("source_id")
|
|
148
157
|
*/
|
|
149
158
|
retrieve(sourceId, requestOptions) {
|
|
159
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(sourceId, requestOptions));
|
|
160
|
+
}
|
|
161
|
+
__retrieve(sourceId, requestOptions) {
|
|
150
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
163
|
var _a, _b, _c;
|
|
152
164
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -154,7 +166,7 @@ class Sources {
|
|
|
154
166
|
method: "GET",
|
|
155
167
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
156
168
|
? yield core.Supplier.get(this._options.project)
|
|
157
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
169
|
+
: 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),
|
|
158
170
|
contentType: "application/json",
|
|
159
171
|
requestType: "json",
|
|
160
172
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -162,13 +174,16 @@ class Sources {
|
|
|
162
174
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
163
175
|
});
|
|
164
176
|
if (_response.ok) {
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
177
|
+
return {
|
|
178
|
+
data: serializers.Source.parseOrThrow(_response.body, {
|
|
179
|
+
unrecognizedObjectKeys: "passthrough",
|
|
180
|
+
allowUnrecognizedUnionMembers: true,
|
|
181
|
+
allowUnrecognizedEnumValues: true,
|
|
182
|
+
skipValidation: true,
|
|
183
|
+
breadcrumbsPrefix: ["response"],
|
|
184
|
+
}),
|
|
185
|
+
rawResponse: _response.rawResponse,
|
|
186
|
+
};
|
|
172
187
|
}
|
|
173
188
|
if (_response.error.reason === "status-code") {
|
|
174
189
|
switch (_response.error.statusCode) {
|
|
@@ -179,11 +194,12 @@ class Sources {
|
|
|
179
194
|
allowUnrecognizedEnumValues: true,
|
|
180
195
|
skipValidation: true,
|
|
181
196
|
breadcrumbsPrefix: ["response"],
|
|
182
|
-
}));
|
|
197
|
+
}), _response.rawResponse);
|
|
183
198
|
default:
|
|
184
199
|
throw new errors.LettaError({
|
|
185
200
|
statusCode: _response.error.statusCode,
|
|
186
201
|
body: _response.error.body,
|
|
202
|
+
rawResponse: _response.rawResponse,
|
|
187
203
|
});
|
|
188
204
|
}
|
|
189
205
|
}
|
|
@@ -192,12 +208,14 @@ class Sources {
|
|
|
192
208
|
throw new errors.LettaError({
|
|
193
209
|
statusCode: _response.error.statusCode,
|
|
194
210
|
body: _response.error.rawBody,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
195
212
|
});
|
|
196
213
|
case "timeout":
|
|
197
214
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/{source_id}.");
|
|
198
215
|
case "unknown":
|
|
199
216
|
throw new errors.LettaError({
|
|
200
217
|
message: _response.error.errorMessage,
|
|
218
|
+
rawResponse: _response.rawResponse,
|
|
201
219
|
});
|
|
202
220
|
}
|
|
203
221
|
});
|
|
@@ -214,6 +232,9 @@ class Sources {
|
|
|
214
232
|
* await client.sources.delete("source_id")
|
|
215
233
|
*/
|
|
216
234
|
delete(sourceId, requestOptions) {
|
|
235
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(sourceId, requestOptions));
|
|
236
|
+
}
|
|
237
|
+
__delete(sourceId, requestOptions) {
|
|
217
238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
239
|
var _a, _b, _c;
|
|
219
240
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -221,7 +242,7 @@ class Sources {
|
|
|
221
242
|
method: "DELETE",
|
|
222
243
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
223
244
|
? yield core.Supplier.get(this._options.project)
|
|
224
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
245
|
+
: 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),
|
|
225
246
|
contentType: "application/json",
|
|
226
247
|
requestType: "json",
|
|
227
248
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -229,7 +250,7 @@ class Sources {
|
|
|
229
250
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
230
251
|
});
|
|
231
252
|
if (_response.ok) {
|
|
232
|
-
return _response.body;
|
|
253
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
233
254
|
}
|
|
234
255
|
if (_response.error.reason === "status-code") {
|
|
235
256
|
switch (_response.error.statusCode) {
|
|
@@ -240,11 +261,12 @@ class Sources {
|
|
|
240
261
|
allowUnrecognizedEnumValues: true,
|
|
241
262
|
skipValidation: true,
|
|
242
263
|
breadcrumbsPrefix: ["response"],
|
|
243
|
-
}));
|
|
264
|
+
}), _response.rawResponse);
|
|
244
265
|
default:
|
|
245
266
|
throw new errors.LettaError({
|
|
246
267
|
statusCode: _response.error.statusCode,
|
|
247
268
|
body: _response.error.body,
|
|
269
|
+
rawResponse: _response.rawResponse,
|
|
248
270
|
});
|
|
249
271
|
}
|
|
250
272
|
}
|
|
@@ -253,12 +275,14 @@ class Sources {
|
|
|
253
275
|
throw new errors.LettaError({
|
|
254
276
|
statusCode: _response.error.statusCode,
|
|
255
277
|
body: _response.error.rawBody,
|
|
278
|
+
rawResponse: _response.rawResponse,
|
|
256
279
|
});
|
|
257
280
|
case "timeout":
|
|
258
281
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/sources/{source_id}.");
|
|
259
282
|
case "unknown":
|
|
260
283
|
throw new errors.LettaError({
|
|
261
284
|
message: _response.error.errorMessage,
|
|
285
|
+
rawResponse: _response.rawResponse,
|
|
262
286
|
});
|
|
263
287
|
}
|
|
264
288
|
});
|
|
@@ -276,6 +300,9 @@ class Sources {
|
|
|
276
300
|
* await client.sources.modify("source_id", {})
|
|
277
301
|
*/
|
|
278
302
|
modify(sourceId, request, requestOptions) {
|
|
303
|
+
return core.HttpResponsePromise.fromPromise(this.__modify(sourceId, request, requestOptions));
|
|
304
|
+
}
|
|
305
|
+
__modify(sourceId, request, requestOptions) {
|
|
279
306
|
return __awaiter(this, void 0, void 0, function* () {
|
|
280
307
|
var _a, _b, _c;
|
|
281
308
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -283,7 +310,7 @@ class Sources {
|
|
|
283
310
|
method: "PATCH",
|
|
284
311
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
285
312
|
? yield core.Supplier.get(this._options.project)
|
|
286
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
313
|
+
: 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),
|
|
287
314
|
contentType: "application/json",
|
|
288
315
|
requestType: "json",
|
|
289
316
|
body: serializers.SourceUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -292,13 +319,16 @@ class Sources {
|
|
|
292
319
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
293
320
|
});
|
|
294
321
|
if (_response.ok) {
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
322
|
+
return {
|
|
323
|
+
data: serializers.Source.parseOrThrow(_response.body, {
|
|
324
|
+
unrecognizedObjectKeys: "passthrough",
|
|
325
|
+
allowUnrecognizedUnionMembers: true,
|
|
326
|
+
allowUnrecognizedEnumValues: true,
|
|
327
|
+
skipValidation: true,
|
|
328
|
+
breadcrumbsPrefix: ["response"],
|
|
329
|
+
}),
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
331
|
+
};
|
|
302
332
|
}
|
|
303
333
|
if (_response.error.reason === "status-code") {
|
|
304
334
|
switch (_response.error.statusCode) {
|
|
@@ -309,11 +339,12 @@ class Sources {
|
|
|
309
339
|
allowUnrecognizedEnumValues: true,
|
|
310
340
|
skipValidation: true,
|
|
311
341
|
breadcrumbsPrefix: ["response"],
|
|
312
|
-
}));
|
|
342
|
+
}), _response.rawResponse);
|
|
313
343
|
default:
|
|
314
344
|
throw new errors.LettaError({
|
|
315
345
|
statusCode: _response.error.statusCode,
|
|
316
346
|
body: _response.error.body,
|
|
347
|
+
rawResponse: _response.rawResponse,
|
|
317
348
|
});
|
|
318
349
|
}
|
|
319
350
|
}
|
|
@@ -322,12 +353,14 @@ class Sources {
|
|
|
322
353
|
throw new errors.LettaError({
|
|
323
354
|
statusCode: _response.error.statusCode,
|
|
324
355
|
body: _response.error.rawBody,
|
|
356
|
+
rawResponse: _response.rawResponse,
|
|
325
357
|
});
|
|
326
358
|
case "timeout":
|
|
327
359
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/sources/{source_id}.");
|
|
328
360
|
case "unknown":
|
|
329
361
|
throw new errors.LettaError({
|
|
330
362
|
message: _response.error.errorMessage,
|
|
363
|
+
rawResponse: _response.rawResponse,
|
|
331
364
|
});
|
|
332
365
|
}
|
|
333
366
|
});
|
|
@@ -344,6 +377,9 @@ class Sources {
|
|
|
344
377
|
* await client.sources.retrieveByName("source_name")
|
|
345
378
|
*/
|
|
346
379
|
retrieveByName(sourceName, requestOptions) {
|
|
380
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieveByName(sourceName, requestOptions));
|
|
381
|
+
}
|
|
382
|
+
__retrieveByName(sourceName, requestOptions) {
|
|
347
383
|
return __awaiter(this, void 0, void 0, function* () {
|
|
348
384
|
var _a, _b, _c;
|
|
349
385
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -351,7 +387,7 @@ class Sources {
|
|
|
351
387
|
method: "GET",
|
|
352
388
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
353
389
|
? yield core.Supplier.get(this._options.project)
|
|
354
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
390
|
+
: 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),
|
|
355
391
|
contentType: "application/json",
|
|
356
392
|
requestType: "json",
|
|
357
393
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -359,13 +395,16 @@ class Sources {
|
|
|
359
395
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
360
396
|
});
|
|
361
397
|
if (_response.ok) {
|
|
362
|
-
return
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
398
|
+
return {
|
|
399
|
+
data: serializers.sources.retrieveByName.Response.parseOrThrow(_response.body, {
|
|
400
|
+
unrecognizedObjectKeys: "passthrough",
|
|
401
|
+
allowUnrecognizedUnionMembers: true,
|
|
402
|
+
allowUnrecognizedEnumValues: true,
|
|
403
|
+
skipValidation: true,
|
|
404
|
+
breadcrumbsPrefix: ["response"],
|
|
405
|
+
}),
|
|
406
|
+
rawResponse: _response.rawResponse,
|
|
407
|
+
};
|
|
369
408
|
}
|
|
370
409
|
if (_response.error.reason === "status-code") {
|
|
371
410
|
switch (_response.error.statusCode) {
|
|
@@ -376,11 +415,12 @@ class Sources {
|
|
|
376
415
|
allowUnrecognizedEnumValues: true,
|
|
377
416
|
skipValidation: true,
|
|
378
417
|
breadcrumbsPrefix: ["response"],
|
|
379
|
-
}));
|
|
418
|
+
}), _response.rawResponse);
|
|
380
419
|
default:
|
|
381
420
|
throw new errors.LettaError({
|
|
382
421
|
statusCode: _response.error.statusCode,
|
|
383
422
|
body: _response.error.body,
|
|
423
|
+
rawResponse: _response.rawResponse,
|
|
384
424
|
});
|
|
385
425
|
}
|
|
386
426
|
}
|
|
@@ -389,12 +429,14 @@ class Sources {
|
|
|
389
429
|
throw new errors.LettaError({
|
|
390
430
|
statusCode: _response.error.statusCode,
|
|
391
431
|
body: _response.error.rawBody,
|
|
432
|
+
rawResponse: _response.rawResponse,
|
|
392
433
|
});
|
|
393
434
|
case "timeout":
|
|
394
435
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/name/{source_name}.");
|
|
395
436
|
case "unknown":
|
|
396
437
|
throw new errors.LettaError({
|
|
397
438
|
message: _response.error.errorMessage,
|
|
439
|
+
rawResponse: _response.rawResponse,
|
|
398
440
|
});
|
|
399
441
|
}
|
|
400
442
|
});
|
|
@@ -416,7 +458,10 @@ class Sources {
|
|
|
416
458
|
* @example
|
|
417
459
|
* await client.sources.getSourcesMetadata()
|
|
418
460
|
*/
|
|
419
|
-
getSourcesMetadata() {
|
|
461
|
+
getSourcesMetadata(request = {}, requestOptions) {
|
|
462
|
+
return core.HttpResponsePromise.fromPromise(this.__getSourcesMetadata(request, requestOptions));
|
|
463
|
+
}
|
|
464
|
+
__getSourcesMetadata() {
|
|
420
465
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
421
466
|
var _a, _b, _c;
|
|
422
467
|
const { includeDetailedPerSourceMetadata } = request;
|
|
@@ -429,7 +474,7 @@ class Sources {
|
|
|
429
474
|
method: "GET",
|
|
430
475
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
431
476
|
? yield core.Supplier.get(this._options.project)
|
|
432
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
477
|
+
: 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),
|
|
433
478
|
contentType: "application/json",
|
|
434
479
|
queryParameters: _queryParams,
|
|
435
480
|
requestType: "json",
|
|
@@ -438,13 +483,16 @@ class Sources {
|
|
|
438
483
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
439
484
|
});
|
|
440
485
|
if (_response.ok) {
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
486
|
+
return {
|
|
487
|
+
data: serializers.OrganizationSourcesStats.parseOrThrow(_response.body, {
|
|
488
|
+
unrecognizedObjectKeys: "passthrough",
|
|
489
|
+
allowUnrecognizedUnionMembers: true,
|
|
490
|
+
allowUnrecognizedEnumValues: true,
|
|
491
|
+
skipValidation: true,
|
|
492
|
+
breadcrumbsPrefix: ["response"],
|
|
493
|
+
}),
|
|
494
|
+
rawResponse: _response.rawResponse,
|
|
495
|
+
};
|
|
448
496
|
}
|
|
449
497
|
if (_response.error.reason === "status-code") {
|
|
450
498
|
switch (_response.error.statusCode) {
|
|
@@ -455,11 +503,12 @@ class Sources {
|
|
|
455
503
|
allowUnrecognizedEnumValues: true,
|
|
456
504
|
skipValidation: true,
|
|
457
505
|
breadcrumbsPrefix: ["response"],
|
|
458
|
-
}));
|
|
506
|
+
}), _response.rawResponse);
|
|
459
507
|
default:
|
|
460
508
|
throw new errors.LettaError({
|
|
461
509
|
statusCode: _response.error.statusCode,
|
|
462
510
|
body: _response.error.body,
|
|
511
|
+
rawResponse: _response.rawResponse,
|
|
463
512
|
});
|
|
464
513
|
}
|
|
465
514
|
}
|
|
@@ -468,12 +517,14 @@ class Sources {
|
|
|
468
517
|
throw new errors.LettaError({
|
|
469
518
|
statusCode: _response.error.statusCode,
|
|
470
519
|
body: _response.error.rawBody,
|
|
520
|
+
rawResponse: _response.rawResponse,
|
|
471
521
|
});
|
|
472
522
|
case "timeout":
|
|
473
523
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/metadata.");
|
|
474
524
|
case "unknown":
|
|
475
525
|
throw new errors.LettaError({
|
|
476
526
|
message: _response.error.errorMessage,
|
|
527
|
+
rawResponse: _response.rawResponse,
|
|
477
528
|
});
|
|
478
529
|
}
|
|
479
530
|
});
|
|
@@ -489,6 +540,9 @@ class Sources {
|
|
|
489
540
|
* await client.sources.list()
|
|
490
541
|
*/
|
|
491
542
|
list(requestOptions) {
|
|
543
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
544
|
+
}
|
|
545
|
+
__list(requestOptions) {
|
|
492
546
|
return __awaiter(this, void 0, void 0, function* () {
|
|
493
547
|
var _a, _b, _c;
|
|
494
548
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -496,7 +550,7 @@ class Sources {
|
|
|
496
550
|
method: "GET",
|
|
497
551
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
498
552
|
? yield core.Supplier.get(this._options.project)
|
|
499
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
553
|
+
: 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),
|
|
500
554
|
contentType: "application/json",
|
|
501
555
|
requestType: "json",
|
|
502
556
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -504,13 +558,16 @@ class Sources {
|
|
|
504
558
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
505
559
|
});
|
|
506
560
|
if (_response.ok) {
|
|
507
|
-
return
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
561
|
+
return {
|
|
562
|
+
data: serializers.sources.list.Response.parseOrThrow(_response.body, {
|
|
563
|
+
unrecognizedObjectKeys: "passthrough",
|
|
564
|
+
allowUnrecognizedUnionMembers: true,
|
|
565
|
+
allowUnrecognizedEnumValues: true,
|
|
566
|
+
skipValidation: true,
|
|
567
|
+
breadcrumbsPrefix: ["response"],
|
|
568
|
+
}),
|
|
569
|
+
rawResponse: _response.rawResponse,
|
|
570
|
+
};
|
|
514
571
|
}
|
|
515
572
|
if (_response.error.reason === "status-code") {
|
|
516
573
|
switch (_response.error.statusCode) {
|
|
@@ -521,11 +578,12 @@ class Sources {
|
|
|
521
578
|
allowUnrecognizedEnumValues: true,
|
|
522
579
|
skipValidation: true,
|
|
523
580
|
breadcrumbsPrefix: ["response"],
|
|
524
|
-
}));
|
|
581
|
+
}), _response.rawResponse);
|
|
525
582
|
default:
|
|
526
583
|
throw new errors.LettaError({
|
|
527
584
|
statusCode: _response.error.statusCode,
|
|
528
585
|
body: _response.error.body,
|
|
586
|
+
rawResponse: _response.rawResponse,
|
|
529
587
|
});
|
|
530
588
|
}
|
|
531
589
|
}
|
|
@@ -534,12 +592,14 @@ class Sources {
|
|
|
534
592
|
throw new errors.LettaError({
|
|
535
593
|
statusCode: _response.error.statusCode,
|
|
536
594
|
body: _response.error.rawBody,
|
|
595
|
+
rawResponse: _response.rawResponse,
|
|
537
596
|
});
|
|
538
597
|
case "timeout":
|
|
539
598
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/.");
|
|
540
599
|
case "unknown":
|
|
541
600
|
throw new errors.LettaError({
|
|
542
601
|
message: _response.error.errorMessage,
|
|
602
|
+
rawResponse: _response.rawResponse,
|
|
543
603
|
});
|
|
544
604
|
}
|
|
545
605
|
});
|
|
@@ -558,6 +618,9 @@ class Sources {
|
|
|
558
618
|
* })
|
|
559
619
|
*/
|
|
560
620
|
create(request, requestOptions) {
|
|
621
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
622
|
+
}
|
|
623
|
+
__create(request, requestOptions) {
|
|
561
624
|
return __awaiter(this, void 0, void 0, function* () {
|
|
562
625
|
var _a, _b, _c;
|
|
563
626
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -565,7 +628,7 @@ class Sources {
|
|
|
565
628
|
method: "POST",
|
|
566
629
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
567
630
|
? yield core.Supplier.get(this._options.project)
|
|
568
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
631
|
+
: 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),
|
|
569
632
|
contentType: "application/json",
|
|
570
633
|
requestType: "json",
|
|
571
634
|
body: serializers.SourceCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -574,13 +637,16 @@ class Sources {
|
|
|
574
637
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
575
638
|
});
|
|
576
639
|
if (_response.ok) {
|
|
577
|
-
return
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
640
|
+
return {
|
|
641
|
+
data: serializers.Source.parseOrThrow(_response.body, {
|
|
642
|
+
unrecognizedObjectKeys: "passthrough",
|
|
643
|
+
allowUnrecognizedUnionMembers: true,
|
|
644
|
+
allowUnrecognizedEnumValues: true,
|
|
645
|
+
skipValidation: true,
|
|
646
|
+
breadcrumbsPrefix: ["response"],
|
|
647
|
+
}),
|
|
648
|
+
rawResponse: _response.rawResponse,
|
|
649
|
+
};
|
|
584
650
|
}
|
|
585
651
|
if (_response.error.reason === "status-code") {
|
|
586
652
|
switch (_response.error.statusCode) {
|
|
@@ -591,11 +657,12 @@ class Sources {
|
|
|
591
657
|
allowUnrecognizedEnumValues: true,
|
|
592
658
|
skipValidation: true,
|
|
593
659
|
breadcrumbsPrefix: ["response"],
|
|
594
|
-
}));
|
|
660
|
+
}), _response.rawResponse);
|
|
595
661
|
default:
|
|
596
662
|
throw new errors.LettaError({
|
|
597
663
|
statusCode: _response.error.statusCode,
|
|
598
664
|
body: _response.error.body,
|
|
665
|
+
rawResponse: _response.rawResponse,
|
|
599
666
|
});
|
|
600
667
|
}
|
|
601
668
|
}
|
|
@@ -604,12 +671,14 @@ class Sources {
|
|
|
604
671
|
throw new errors.LettaError({
|
|
605
672
|
statusCode: _response.error.statusCode,
|
|
606
673
|
body: _response.error.rawBody,
|
|
674
|
+
rawResponse: _response.rawResponse,
|
|
607
675
|
});
|
|
608
676
|
case "timeout":
|
|
609
677
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/sources/.");
|
|
610
678
|
case "unknown":
|
|
611
679
|
throw new errors.LettaError({
|
|
612
680
|
message: _response.error.errorMessage,
|
|
681
|
+
rawResponse: _response.rawResponse,
|
|
613
682
|
});
|
|
614
683
|
}
|
|
615
684
|
});
|
|
@@ -626,6 +695,9 @@ class Sources {
|
|
|
626
695
|
* await client.sources.getAgentsForSource("source_id")
|
|
627
696
|
*/
|
|
628
697
|
getAgentsForSource(sourceId, requestOptions) {
|
|
698
|
+
return core.HttpResponsePromise.fromPromise(this.__getAgentsForSource(sourceId, requestOptions));
|
|
699
|
+
}
|
|
700
|
+
__getAgentsForSource(sourceId, requestOptions) {
|
|
629
701
|
return __awaiter(this, void 0, void 0, function* () {
|
|
630
702
|
var _a, _b, _c;
|
|
631
703
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -633,7 +705,7 @@ class Sources {
|
|
|
633
705
|
method: "GET",
|
|
634
706
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
635
707
|
? yield core.Supplier.get(this._options.project)
|
|
636
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
708
|
+
: 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),
|
|
637
709
|
contentType: "application/json",
|
|
638
710
|
requestType: "json",
|
|
639
711
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -641,13 +713,16 @@ class Sources {
|
|
|
641
713
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
642
714
|
});
|
|
643
715
|
if (_response.ok) {
|
|
644
|
-
return
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
716
|
+
return {
|
|
717
|
+
data: serializers.sources.getAgentsForSource.Response.parseOrThrow(_response.body, {
|
|
718
|
+
unrecognizedObjectKeys: "passthrough",
|
|
719
|
+
allowUnrecognizedUnionMembers: true,
|
|
720
|
+
allowUnrecognizedEnumValues: true,
|
|
721
|
+
skipValidation: true,
|
|
722
|
+
breadcrumbsPrefix: ["response"],
|
|
723
|
+
}),
|
|
724
|
+
rawResponse: _response.rawResponse,
|
|
725
|
+
};
|
|
651
726
|
}
|
|
652
727
|
if (_response.error.reason === "status-code") {
|
|
653
728
|
switch (_response.error.statusCode) {
|
|
@@ -658,11 +733,12 @@ class Sources {
|
|
|
658
733
|
allowUnrecognizedEnumValues: true,
|
|
659
734
|
skipValidation: true,
|
|
660
735
|
breadcrumbsPrefix: ["response"],
|
|
661
|
-
}));
|
|
736
|
+
}), _response.rawResponse);
|
|
662
737
|
default:
|
|
663
738
|
throw new errors.LettaError({
|
|
664
739
|
statusCode: _response.error.statusCode,
|
|
665
740
|
body: _response.error.body,
|
|
741
|
+
rawResponse: _response.rawResponse,
|
|
666
742
|
});
|
|
667
743
|
}
|
|
668
744
|
}
|
|
@@ -671,12 +747,14 @@ class Sources {
|
|
|
671
747
|
throw new errors.LettaError({
|
|
672
748
|
statusCode: _response.error.statusCode,
|
|
673
749
|
body: _response.error.rawBody,
|
|
750
|
+
rawResponse: _response.rawResponse,
|
|
674
751
|
});
|
|
675
752
|
case "timeout":
|
|
676
753
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/{source_id}/agents.");
|
|
677
754
|
case "unknown":
|
|
678
755
|
throw new errors.LettaError({
|
|
679
756
|
message: _response.error.errorMessage,
|
|
757
|
+
rawResponse: _response.rawResponse,
|
|
680
758
|
});
|
|
681
759
|
}
|
|
682
760
|
});
|
|
@@ -694,7 +772,10 @@ class Sources {
|
|
|
694
772
|
* @example
|
|
695
773
|
* await client.sources.getFileMetadata("source_id", "file_id")
|
|
696
774
|
*/
|
|
697
|
-
getFileMetadata(
|
|
775
|
+
getFileMetadata(sourceId, fileId, request = {}, requestOptions) {
|
|
776
|
+
return core.HttpResponsePromise.fromPromise(this.__getFileMetadata(sourceId, fileId, request, requestOptions));
|
|
777
|
+
}
|
|
778
|
+
__getFileMetadata(sourceId_1, fileId_1) {
|
|
698
779
|
return __awaiter(this, arguments, void 0, function* (sourceId, fileId, request = {}, requestOptions) {
|
|
699
780
|
var _a, _b, _c;
|
|
700
781
|
const { includeContent } = request;
|
|
@@ -707,7 +788,7 @@ class Sources {
|
|
|
707
788
|
method: "GET",
|
|
708
789
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
709
790
|
? yield core.Supplier.get(this._options.project)
|
|
710
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
791
|
+
: 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),
|
|
711
792
|
contentType: "application/json",
|
|
712
793
|
queryParameters: _queryParams,
|
|
713
794
|
requestType: "json",
|
|
@@ -716,13 +797,16 @@ class Sources {
|
|
|
716
797
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
717
798
|
});
|
|
718
799
|
if (_response.ok) {
|
|
719
|
-
return
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
800
|
+
return {
|
|
801
|
+
data: serializers.FileMetadata.parseOrThrow(_response.body, {
|
|
802
|
+
unrecognizedObjectKeys: "passthrough",
|
|
803
|
+
allowUnrecognizedUnionMembers: true,
|
|
804
|
+
allowUnrecognizedEnumValues: true,
|
|
805
|
+
skipValidation: true,
|
|
806
|
+
breadcrumbsPrefix: ["response"],
|
|
807
|
+
}),
|
|
808
|
+
rawResponse: _response.rawResponse,
|
|
809
|
+
};
|
|
726
810
|
}
|
|
727
811
|
if (_response.error.reason === "status-code") {
|
|
728
812
|
switch (_response.error.statusCode) {
|
|
@@ -733,11 +817,12 @@ class Sources {
|
|
|
733
817
|
allowUnrecognizedEnumValues: true,
|
|
734
818
|
skipValidation: true,
|
|
735
819
|
breadcrumbsPrefix: ["response"],
|
|
736
|
-
}));
|
|
820
|
+
}), _response.rawResponse);
|
|
737
821
|
default:
|
|
738
822
|
throw new errors.LettaError({
|
|
739
823
|
statusCode: _response.error.statusCode,
|
|
740
824
|
body: _response.error.body,
|
|
825
|
+
rawResponse: _response.rawResponse,
|
|
741
826
|
});
|
|
742
827
|
}
|
|
743
828
|
}
|
|
@@ -746,12 +831,14 @@ class Sources {
|
|
|
746
831
|
throw new errors.LettaError({
|
|
747
832
|
statusCode: _response.error.statusCode,
|
|
748
833
|
body: _response.error.rawBody,
|
|
834
|
+
rawResponse: _response.rawResponse,
|
|
749
835
|
});
|
|
750
836
|
case "timeout":
|
|
751
837
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/sources/{source_id}/files/{file_id}.");
|
|
752
838
|
case "unknown":
|
|
753
839
|
throw new errors.LettaError({
|
|
754
840
|
message: _response.error.errorMessage,
|
|
841
|
+
rawResponse: _response.rawResponse,
|
|
755
842
|
});
|
|
756
843
|
}
|
|
757
844
|
});
|