@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
|
@@ -45,7 +45,8 @@ export declare class Files {
|
|
|
45
45
|
* @example
|
|
46
46
|
* await client.folders.files.upload(fs.createReadStream("/path/to/your/file"), "folder_id", {})
|
|
47
47
|
*/
|
|
48
|
-
upload(file: File | fs.ReadStream | Blob, folderId: string, request: Letta.folders.BodyUploadFileToFolder, requestOptions?: Files.RequestOptions):
|
|
48
|
+
upload(file: File | fs.ReadStream | Blob, folderId: string, request: Letta.folders.BodyUploadFileToFolder, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<Letta.FileMetadata>;
|
|
49
|
+
private __upload;
|
|
49
50
|
/**
|
|
50
51
|
* List paginated files associated with a data folder.
|
|
51
52
|
*
|
|
@@ -58,7 +59,8 @@ export declare class Files {
|
|
|
58
59
|
* @example
|
|
59
60
|
* await client.folders.files.list("folder_id")
|
|
60
61
|
*/
|
|
61
|
-
list(folderId: string, request?: Letta.folders.FilesListRequest, requestOptions?: Files.RequestOptions):
|
|
62
|
+
list(folderId: string, request?: Letta.folders.FilesListRequest, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<Letta.FileMetadata[]>;
|
|
63
|
+
private __list;
|
|
62
64
|
/**
|
|
63
65
|
* Delete a file from a folder.
|
|
64
66
|
*
|
|
@@ -71,7 +73,8 @@ export declare class Files {
|
|
|
71
73
|
* @example
|
|
72
74
|
* await client.folders.files.delete("folder_id", "file_id")
|
|
73
75
|
*/
|
|
74
|
-
delete(folderId: string, fileId: string, requestOptions?: Files.RequestOptions):
|
|
76
|
+
delete(folderId: string, fileId: string, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<void>;
|
|
77
|
+
private __delete;
|
|
75
78
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
76
79
|
Authorization: string;
|
|
77
80
|
}>;
|
|
@@ -52,8 +52,8 @@ exports.Files = void 0;
|
|
|
52
52
|
const environments = __importStar(require("../../../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../../../core"));
|
|
54
54
|
const Letta = __importStar(require("../../../../../index"));
|
|
55
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
56
55
|
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
56
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
57
57
|
const errors = __importStar(require("../../../../../../errors/index"));
|
|
58
58
|
class Files {
|
|
59
59
|
constructor(_options = {}) {
|
|
@@ -73,11 +73,14 @@ class Files {
|
|
|
73
73
|
* await client.folders.files.upload(fs.createReadStream("/path/to/your/file"), "folder_id", {})
|
|
74
74
|
*/
|
|
75
75
|
upload(file, folderId, request, requestOptions) {
|
|
76
|
+
return core.HttpResponsePromise.fromPromise(this.__upload(file, folderId, request, requestOptions));
|
|
77
|
+
}
|
|
78
|
+
__upload(file, folderId, request, requestOptions) {
|
|
76
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
80
|
var _a, _b, _c;
|
|
78
81
|
const _queryParams = {};
|
|
79
82
|
if (request.duplicateHandling != null) {
|
|
80
|
-
_queryParams["duplicate_handling"] = request.duplicateHandling;
|
|
83
|
+
_queryParams["duplicate_handling"] = serializers.DuplicateFileHandling.jsonOrThrow(request.duplicateHandling, { unrecognizedObjectKeys: "strip" });
|
|
81
84
|
}
|
|
82
85
|
const _request = yield core.newFormData();
|
|
83
86
|
yield _request.appendFile("file", file);
|
|
@@ -87,7 +90,7 @@ class Files {
|
|
|
87
90
|
method: "POST",
|
|
88
91
|
headers: Object.assign(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())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
91
94
|
queryParameters: _queryParams,
|
|
92
95
|
requestType: "file",
|
|
93
96
|
duplex: _maybeEncodedRequest.duplex,
|
|
@@ -97,13 +100,16 @@ class Files {
|
|
|
97
100
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
98
101
|
});
|
|
99
102
|
if (_response.ok) {
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
return {
|
|
104
|
+
data: serializers.FileMetadata.parseOrThrow(_response.body, {
|
|
105
|
+
unrecognizedObjectKeys: "passthrough",
|
|
106
|
+
allowUnrecognizedUnionMembers: true,
|
|
107
|
+
allowUnrecognizedEnumValues: true,
|
|
108
|
+
skipValidation: true,
|
|
109
|
+
breadcrumbsPrefix: ["response"],
|
|
110
|
+
}),
|
|
111
|
+
rawResponse: _response.rawResponse,
|
|
112
|
+
};
|
|
107
113
|
}
|
|
108
114
|
if (_response.error.reason === "status-code") {
|
|
109
115
|
switch (_response.error.statusCode) {
|
|
@@ -114,11 +120,12 @@ class Files {
|
|
|
114
120
|
allowUnrecognizedEnumValues: true,
|
|
115
121
|
skipValidation: true,
|
|
116
122
|
breadcrumbsPrefix: ["response"],
|
|
117
|
-
}));
|
|
123
|
+
}), _response.rawResponse);
|
|
118
124
|
default:
|
|
119
125
|
throw new errors.LettaError({
|
|
120
126
|
statusCode: _response.error.statusCode,
|
|
121
127
|
body: _response.error.body,
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
122
129
|
});
|
|
123
130
|
}
|
|
124
131
|
}
|
|
@@ -127,12 +134,14 @@ class Files {
|
|
|
127
134
|
throw new errors.LettaError({
|
|
128
135
|
statusCode: _response.error.statusCode,
|
|
129
136
|
body: _response.error.rawBody,
|
|
137
|
+
rawResponse: _response.rawResponse,
|
|
130
138
|
});
|
|
131
139
|
case "timeout":
|
|
132
140
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/folders/{folder_id}/upload.");
|
|
133
141
|
case "unknown":
|
|
134
142
|
throw new errors.LettaError({
|
|
135
143
|
message: _response.error.errorMessage,
|
|
144
|
+
rawResponse: _response.rawResponse,
|
|
136
145
|
});
|
|
137
146
|
}
|
|
138
147
|
});
|
|
@@ -149,7 +158,10 @@ class Files {
|
|
|
149
158
|
* @example
|
|
150
159
|
* await client.folders.files.list("folder_id")
|
|
151
160
|
*/
|
|
152
|
-
list(
|
|
161
|
+
list(folderId, request = {}, requestOptions) {
|
|
162
|
+
return core.HttpResponsePromise.fromPromise(this.__list(folderId, request, requestOptions));
|
|
163
|
+
}
|
|
164
|
+
__list(folderId_1) {
|
|
153
165
|
return __awaiter(this, arguments, void 0, function* (folderId, request = {}, requestOptions) {
|
|
154
166
|
var _a, _b, _c;
|
|
155
167
|
const { limit, after, includeContent } = request;
|
|
@@ -168,7 +180,7 @@ class Files {
|
|
|
168
180
|
method: "GET",
|
|
169
181
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
170
182
|
? yield core.Supplier.get(this._options.project)
|
|
171
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
183
|
+
: 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),
|
|
172
184
|
contentType: "application/json",
|
|
173
185
|
queryParameters: _queryParams,
|
|
174
186
|
requestType: "json",
|
|
@@ -177,13 +189,16 @@ class Files {
|
|
|
177
189
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
178
190
|
});
|
|
179
191
|
if (_response.ok) {
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
192
|
+
return {
|
|
193
|
+
data: serializers.folders.files.list.Response.parseOrThrow(_response.body, {
|
|
194
|
+
unrecognizedObjectKeys: "passthrough",
|
|
195
|
+
allowUnrecognizedUnionMembers: true,
|
|
196
|
+
allowUnrecognizedEnumValues: true,
|
|
197
|
+
skipValidation: true,
|
|
198
|
+
breadcrumbsPrefix: ["response"],
|
|
199
|
+
}),
|
|
200
|
+
rawResponse: _response.rawResponse,
|
|
201
|
+
};
|
|
187
202
|
}
|
|
188
203
|
if (_response.error.reason === "status-code") {
|
|
189
204
|
switch (_response.error.statusCode) {
|
|
@@ -194,11 +209,12 @@ class Files {
|
|
|
194
209
|
allowUnrecognizedEnumValues: true,
|
|
195
210
|
skipValidation: true,
|
|
196
211
|
breadcrumbsPrefix: ["response"],
|
|
197
|
-
}));
|
|
212
|
+
}), _response.rawResponse);
|
|
198
213
|
default:
|
|
199
214
|
throw new errors.LettaError({
|
|
200
215
|
statusCode: _response.error.statusCode,
|
|
201
216
|
body: _response.error.body,
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
202
218
|
});
|
|
203
219
|
}
|
|
204
220
|
}
|
|
@@ -207,12 +223,14 @@ class Files {
|
|
|
207
223
|
throw new errors.LettaError({
|
|
208
224
|
statusCode: _response.error.statusCode,
|
|
209
225
|
body: _response.error.rawBody,
|
|
226
|
+
rawResponse: _response.rawResponse,
|
|
210
227
|
});
|
|
211
228
|
case "timeout":
|
|
212
229
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/folders/{folder_id}/files.");
|
|
213
230
|
case "unknown":
|
|
214
231
|
throw new errors.LettaError({
|
|
215
232
|
message: _response.error.errorMessage,
|
|
233
|
+
rawResponse: _response.rawResponse,
|
|
216
234
|
});
|
|
217
235
|
}
|
|
218
236
|
});
|
|
@@ -230,6 +248,9 @@ class Files {
|
|
|
230
248
|
* await client.folders.files.delete("folder_id", "file_id")
|
|
231
249
|
*/
|
|
232
250
|
delete(folderId, fileId, requestOptions) {
|
|
251
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(folderId, fileId, requestOptions));
|
|
252
|
+
}
|
|
253
|
+
__delete(folderId, fileId, requestOptions) {
|
|
233
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
255
|
var _a, _b, _c;
|
|
235
256
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -237,7 +258,7 @@ class Files {
|
|
|
237
258
|
method: "DELETE",
|
|
238
259
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
239
260
|
? yield core.Supplier.get(this._options.project)
|
|
240
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
261
|
+
: 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),
|
|
241
262
|
contentType: "application/json",
|
|
242
263
|
requestType: "json",
|
|
243
264
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -245,7 +266,7 @@ class Files {
|
|
|
245
266
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
246
267
|
});
|
|
247
268
|
if (_response.ok) {
|
|
248
|
-
return;
|
|
269
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
249
270
|
}
|
|
250
271
|
if (_response.error.reason === "status-code") {
|
|
251
272
|
switch (_response.error.statusCode) {
|
|
@@ -256,11 +277,12 @@ class Files {
|
|
|
256
277
|
allowUnrecognizedEnumValues: true,
|
|
257
278
|
skipValidation: true,
|
|
258
279
|
breadcrumbsPrefix: ["response"],
|
|
259
|
-
}));
|
|
280
|
+
}), _response.rawResponse);
|
|
260
281
|
default:
|
|
261
282
|
throw new errors.LettaError({
|
|
262
283
|
statusCode: _response.error.statusCode,
|
|
263
284
|
body: _response.error.body,
|
|
285
|
+
rawResponse: _response.rawResponse,
|
|
264
286
|
});
|
|
265
287
|
}
|
|
266
288
|
}
|
|
@@ -269,12 +291,14 @@ class Files {
|
|
|
269
291
|
throw new errors.LettaError({
|
|
270
292
|
statusCode: _response.error.statusCode,
|
|
271
293
|
body: _response.error.rawBody,
|
|
294
|
+
rawResponse: _response.rawResponse,
|
|
272
295
|
});
|
|
273
296
|
case "timeout":
|
|
274
297
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/folders/{folder_id}/{file_id}.");
|
|
275
298
|
case "unknown":
|
|
276
299
|
throw new errors.LettaError({
|
|
277
300
|
message: _response.error.errorMessage,
|
|
301
|
+
rawResponse: _response.rawResponse,
|
|
278
302
|
});
|
|
279
303
|
}
|
|
280
304
|
});
|
|
@@ -42,7 +42,8 @@ export declare class Passages {
|
|
|
42
42
|
* @example
|
|
43
43
|
* await client.folders.passages.list("folder_id")
|
|
44
44
|
*/
|
|
45
|
-
list(folderId: string, request?: Letta.folders.PassagesListRequest, requestOptions?: Passages.RequestOptions):
|
|
45
|
+
list(folderId: string, request?: Letta.folders.PassagesListRequest, requestOptions?: Passages.RequestOptions): core.HttpResponsePromise<Letta.Passage[]>;
|
|
46
|
+
private __list;
|
|
46
47
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
47
48
|
Authorization: string;
|
|
48
49
|
}>;
|
|
@@ -71,7 +71,10 @@ class Passages {
|
|
|
71
71
|
* @example
|
|
72
72
|
* await client.folders.passages.list("folder_id")
|
|
73
73
|
*/
|
|
74
|
-
list(
|
|
74
|
+
list(folderId, request = {}, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__list(folderId, request, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__list(folderId_1) {
|
|
75
78
|
return __awaiter(this, arguments, void 0, function* (folderId, request = {}, requestOptions) {
|
|
76
79
|
var _a, _b, _c;
|
|
77
80
|
const { after, before, limit } = request;
|
|
@@ -90,7 +93,7 @@ class Passages {
|
|
|
90
93
|
method: "GET",
|
|
91
94
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
92
95
|
? yield core.Supplier.get(this._options.project)
|
|
93
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
96
|
+
: 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),
|
|
94
97
|
contentType: "application/json",
|
|
95
98
|
queryParameters: _queryParams,
|
|
96
99
|
requestType: "json",
|
|
@@ -99,13 +102,16 @@ class Passages {
|
|
|
99
102
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
100
103
|
});
|
|
101
104
|
if (_response.ok) {
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
return {
|
|
106
|
+
data: serializers.folders.passages.list.Response.parseOrThrow(_response.body, {
|
|
107
|
+
unrecognizedObjectKeys: "passthrough",
|
|
108
|
+
allowUnrecognizedUnionMembers: true,
|
|
109
|
+
allowUnrecognizedEnumValues: true,
|
|
110
|
+
skipValidation: true,
|
|
111
|
+
breadcrumbsPrefix: ["response"],
|
|
112
|
+
}),
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
114
|
+
};
|
|
109
115
|
}
|
|
110
116
|
if (_response.error.reason === "status-code") {
|
|
111
117
|
switch (_response.error.statusCode) {
|
|
@@ -116,11 +122,12 @@ class Passages {
|
|
|
116
122
|
allowUnrecognizedEnumValues: true,
|
|
117
123
|
skipValidation: true,
|
|
118
124
|
breadcrumbsPrefix: ["response"],
|
|
119
|
-
}));
|
|
125
|
+
}), _response.rawResponse);
|
|
120
126
|
default:
|
|
121
127
|
throw new errors.LettaError({
|
|
122
128
|
statusCode: _response.error.statusCode,
|
|
123
129
|
body: _response.error.body,
|
|
130
|
+
rawResponse: _response.rawResponse,
|
|
124
131
|
});
|
|
125
132
|
}
|
|
126
133
|
}
|
|
@@ -129,12 +136,14 @@ class Passages {
|
|
|
129
136
|
throw new errors.LettaError({
|
|
130
137
|
statusCode: _response.error.statusCode,
|
|
131
138
|
body: _response.error.rawBody,
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
132
140
|
});
|
|
133
141
|
case "timeout":
|
|
134
142
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/folders/{folder_id}/passages.");
|
|
135
143
|
case "unknown":
|
|
136
144
|
throw new errors.LettaError({
|
|
137
145
|
message: _response.error.errorMessage,
|
|
146
|
+
rawResponse: _response.rawResponse,
|
|
138
147
|
});
|
|
139
148
|
}
|
|
140
149
|
});
|
|
@@ -44,7 +44,8 @@ export declare class Groups {
|
|
|
44
44
|
* @example
|
|
45
45
|
* await client.groups.list()
|
|
46
46
|
*/
|
|
47
|
-
list(request?: Letta.GroupsListRequest, requestOptions?: Groups.RequestOptions):
|
|
47
|
+
list(request?: Letta.GroupsListRequest, requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<Letta.Group[]>;
|
|
48
|
+
private __list;
|
|
48
49
|
/**
|
|
49
50
|
* Create a new multi-agent group with the specified configuration.
|
|
50
51
|
*
|
|
@@ -59,7 +60,8 @@ export declare class Groups {
|
|
|
59
60
|
* description: "description"
|
|
60
61
|
* })
|
|
61
62
|
*/
|
|
62
|
-
create(request: Letta.GroupCreate, requestOptions?: Groups.RequestOptions):
|
|
63
|
+
create(request: Letta.GroupCreate, requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<Letta.Group>;
|
|
64
|
+
private __create;
|
|
63
65
|
/**
|
|
64
66
|
* Get the count of all groups associated with a given user.
|
|
65
67
|
*
|
|
@@ -70,7 +72,8 @@ export declare class Groups {
|
|
|
70
72
|
* @example
|
|
71
73
|
* await client.groups.count()
|
|
72
74
|
*/
|
|
73
|
-
count(requestOptions?: Groups.RequestOptions):
|
|
75
|
+
count(requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<number>;
|
|
76
|
+
private __count;
|
|
74
77
|
/**
|
|
75
78
|
* Retrieve the group by id.
|
|
76
79
|
*
|
|
@@ -82,7 +85,8 @@ export declare class Groups {
|
|
|
82
85
|
* @example
|
|
83
86
|
* await client.groups.retrieve("group_id")
|
|
84
87
|
*/
|
|
85
|
-
retrieve(groupId: string, requestOptions?: Groups.RequestOptions):
|
|
88
|
+
retrieve(groupId: string, requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<Letta.Group>;
|
|
89
|
+
private __retrieve;
|
|
86
90
|
/**
|
|
87
91
|
* Delete a multi-agent group.
|
|
88
92
|
*
|
|
@@ -94,7 +98,8 @@ export declare class Groups {
|
|
|
94
98
|
* @example
|
|
95
99
|
* await client.groups.delete("group_id")
|
|
96
100
|
*/
|
|
97
|
-
delete(groupId: string, requestOptions?: Groups.RequestOptions):
|
|
101
|
+
delete(groupId: string, requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
102
|
+
private __delete;
|
|
98
103
|
/**
|
|
99
104
|
* Create a new multi-agent group with the specified configuration.
|
|
100
105
|
*
|
|
@@ -107,7 +112,8 @@ export declare class Groups {
|
|
|
107
112
|
* @example
|
|
108
113
|
* await client.groups.modify("group_id")
|
|
109
114
|
*/
|
|
110
|
-
modify(groupId: string, request?: Letta.GroupUpdate, requestOptions?: Groups.RequestOptions):
|
|
115
|
+
modify(groupId: string, request?: Letta.GroupUpdate, requestOptions?: Groups.RequestOptions): core.HttpResponsePromise<Letta.Group>;
|
|
116
|
+
private __modify;
|
|
111
117
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
112
118
|
Authorization: string;
|
|
113
119
|
}>;
|