@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
|
@@ -42,7 +42,8 @@ export declare class Blocks {
|
|
|
42
42
|
* @example
|
|
43
43
|
* await client.agents.blocks.retrieve("agent_id", "block_label")
|
|
44
44
|
*/
|
|
45
|
-
retrieve(agentId: string, blockLabel: string, requestOptions?: Blocks.RequestOptions):
|
|
45
|
+
retrieve(agentId: string, blockLabel: string, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block>;
|
|
46
|
+
private __retrieve;
|
|
46
47
|
/**
|
|
47
48
|
* Updates a core memory block of an agent.
|
|
48
49
|
*
|
|
@@ -56,7 +57,8 @@ export declare class Blocks {
|
|
|
56
57
|
* @example
|
|
57
58
|
* await client.agents.blocks.modify("agent_id", "block_label", {})
|
|
58
59
|
*/
|
|
59
|
-
modify(agentId: string, blockLabel: string, request: Letta.BlockUpdate, requestOptions?: Blocks.RequestOptions):
|
|
60
|
+
modify(agentId: string, blockLabel: string, request: Letta.BlockUpdate, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block>;
|
|
61
|
+
private __modify;
|
|
60
62
|
/**
|
|
61
63
|
* Retrieve the core memory blocks of a specific agent.
|
|
62
64
|
*
|
|
@@ -68,7 +70,8 @@ export declare class Blocks {
|
|
|
68
70
|
* @example
|
|
69
71
|
* await client.agents.blocks.list("agent_id")
|
|
70
72
|
*/
|
|
71
|
-
list(agentId: string, requestOptions?: Blocks.RequestOptions):
|
|
73
|
+
list(agentId: string, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.Block[]>;
|
|
74
|
+
private __list;
|
|
72
75
|
/**
|
|
73
76
|
* Attach a core memory block to an agent.
|
|
74
77
|
*
|
|
@@ -81,7 +84,8 @@ export declare class Blocks {
|
|
|
81
84
|
* @example
|
|
82
85
|
* await client.agents.blocks.attach("agent_id", "block_id")
|
|
83
86
|
*/
|
|
84
|
-
attach(agentId: string, blockId: string, requestOptions?: Blocks.RequestOptions):
|
|
87
|
+
attach(agentId: string, blockId: string, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
88
|
+
private __attach;
|
|
85
89
|
/**
|
|
86
90
|
* Detach a core memory block from an agent.
|
|
87
91
|
*
|
|
@@ -94,7 +98,8 @@ export declare class Blocks {
|
|
|
94
98
|
* @example
|
|
95
99
|
* await client.agents.blocks.detach("agent_id", "block_id")
|
|
96
100
|
*/
|
|
97
|
-
detach(agentId: string, blockId: string, requestOptions?: Blocks.RequestOptions):
|
|
101
|
+
detach(agentId: string, blockId: string, requestOptions?: Blocks.RequestOptions): core.HttpResponsePromise<Letta.AgentState>;
|
|
102
|
+
private __detach;
|
|
98
103
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
99
104
|
Authorization: string;
|
|
100
105
|
}>;
|
|
@@ -72,6 +72,9 @@ class Blocks {
|
|
|
72
72
|
* await client.agents.blocks.retrieve("agent_id", "block_label")
|
|
73
73
|
*/
|
|
74
74
|
retrieve(agentId, blockLabel, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(agentId, blockLabel, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__retrieve(agentId, blockLabel, requestOptions) {
|
|
75
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
79
|
var _a, _b, _c;
|
|
77
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -79,7 +82,7 @@ class Blocks {
|
|
|
79
82
|
method: "GET",
|
|
80
83
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
84
|
? yield core.Supplier.get(this._options.project)
|
|
82
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
83
86
|
contentType: "application/json",
|
|
84
87
|
requestType: "json",
|
|
85
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -87,13 +90,16 @@ class Blocks {
|
|
|
87
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
91
|
});
|
|
89
92
|
if (_response.ok) {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
return {
|
|
94
|
+
data: serializers.Block.parseOrThrow(_response.body, {
|
|
95
|
+
unrecognizedObjectKeys: "passthrough",
|
|
96
|
+
allowUnrecognizedUnionMembers: true,
|
|
97
|
+
allowUnrecognizedEnumValues: true,
|
|
98
|
+
skipValidation: true,
|
|
99
|
+
breadcrumbsPrefix: ["response"],
|
|
100
|
+
}),
|
|
101
|
+
rawResponse: _response.rawResponse,
|
|
102
|
+
};
|
|
97
103
|
}
|
|
98
104
|
if (_response.error.reason === "status-code") {
|
|
99
105
|
switch (_response.error.statusCode) {
|
|
@@ -104,11 +110,12 @@ class Blocks {
|
|
|
104
110
|
allowUnrecognizedEnumValues: true,
|
|
105
111
|
skipValidation: true,
|
|
106
112
|
breadcrumbsPrefix: ["response"],
|
|
107
|
-
}));
|
|
113
|
+
}), _response.rawResponse);
|
|
108
114
|
default:
|
|
109
115
|
throw new errors.LettaError({
|
|
110
116
|
statusCode: _response.error.statusCode,
|
|
111
117
|
body: _response.error.body,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
112
119
|
});
|
|
113
120
|
}
|
|
114
121
|
}
|
|
@@ -117,12 +124,14 @@ class Blocks {
|
|
|
117
124
|
throw new errors.LettaError({
|
|
118
125
|
statusCode: _response.error.statusCode,
|
|
119
126
|
body: _response.error.rawBody,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
120
128
|
});
|
|
121
129
|
case "timeout":
|
|
122
130
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
|
|
123
131
|
case "unknown":
|
|
124
132
|
throw new errors.LettaError({
|
|
125
133
|
message: _response.error.errorMessage,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
126
135
|
});
|
|
127
136
|
}
|
|
128
137
|
});
|
|
@@ -141,6 +150,9 @@ class Blocks {
|
|
|
141
150
|
* await client.agents.blocks.modify("agent_id", "block_label", {})
|
|
142
151
|
*/
|
|
143
152
|
modify(agentId, blockLabel, request, requestOptions) {
|
|
153
|
+
return core.HttpResponsePromise.fromPromise(this.__modify(agentId, blockLabel, request, requestOptions));
|
|
154
|
+
}
|
|
155
|
+
__modify(agentId, blockLabel, request, requestOptions) {
|
|
144
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
157
|
var _a, _b, _c;
|
|
146
158
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -148,7 +160,7 @@ class Blocks {
|
|
|
148
160
|
method: "PATCH",
|
|
149
161
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
150
162
|
? yield core.Supplier.get(this._options.project)
|
|
151
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
163
|
+
: 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),
|
|
152
164
|
contentType: "application/json",
|
|
153
165
|
requestType: "json",
|
|
154
166
|
body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -157,13 +169,16 @@ class Blocks {
|
|
|
157
169
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
158
170
|
});
|
|
159
171
|
if (_response.ok) {
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
return {
|
|
173
|
+
data: serializers.Block.parseOrThrow(_response.body, {
|
|
174
|
+
unrecognizedObjectKeys: "passthrough",
|
|
175
|
+
allowUnrecognizedUnionMembers: true,
|
|
176
|
+
allowUnrecognizedEnumValues: true,
|
|
177
|
+
skipValidation: true,
|
|
178
|
+
breadcrumbsPrefix: ["response"],
|
|
179
|
+
}),
|
|
180
|
+
rawResponse: _response.rawResponse,
|
|
181
|
+
};
|
|
167
182
|
}
|
|
168
183
|
if (_response.error.reason === "status-code") {
|
|
169
184
|
switch (_response.error.statusCode) {
|
|
@@ -174,11 +189,12 @@ class Blocks {
|
|
|
174
189
|
allowUnrecognizedEnumValues: true,
|
|
175
190
|
skipValidation: true,
|
|
176
191
|
breadcrumbsPrefix: ["response"],
|
|
177
|
-
}));
|
|
192
|
+
}), _response.rawResponse);
|
|
178
193
|
default:
|
|
179
194
|
throw new errors.LettaError({
|
|
180
195
|
statusCode: _response.error.statusCode,
|
|
181
196
|
body: _response.error.body,
|
|
197
|
+
rawResponse: _response.rawResponse,
|
|
182
198
|
});
|
|
183
199
|
}
|
|
184
200
|
}
|
|
@@ -187,12 +203,14 @@ class Blocks {
|
|
|
187
203
|
throw new errors.LettaError({
|
|
188
204
|
statusCode: _response.error.statusCode,
|
|
189
205
|
body: _response.error.rawBody,
|
|
206
|
+
rawResponse: _response.rawResponse,
|
|
190
207
|
});
|
|
191
208
|
case "timeout":
|
|
192
209
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/{block_label}.");
|
|
193
210
|
case "unknown":
|
|
194
211
|
throw new errors.LettaError({
|
|
195
212
|
message: _response.error.errorMessage,
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
196
214
|
});
|
|
197
215
|
}
|
|
198
216
|
});
|
|
@@ -209,6 +227,9 @@ class Blocks {
|
|
|
209
227
|
* await client.agents.blocks.list("agent_id")
|
|
210
228
|
*/
|
|
211
229
|
list(agentId, requestOptions) {
|
|
230
|
+
return core.HttpResponsePromise.fromPromise(this.__list(agentId, requestOptions));
|
|
231
|
+
}
|
|
232
|
+
__list(agentId, requestOptions) {
|
|
212
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
213
234
|
var _a, _b, _c;
|
|
214
235
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -216,7 +237,7 @@ class Blocks {
|
|
|
216
237
|
method: "GET",
|
|
217
238
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
218
239
|
? yield core.Supplier.get(this._options.project)
|
|
219
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
240
|
+
: 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),
|
|
220
241
|
contentType: "application/json",
|
|
221
242
|
requestType: "json",
|
|
222
243
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -224,13 +245,16 @@ class Blocks {
|
|
|
224
245
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
225
246
|
});
|
|
226
247
|
if (_response.ok) {
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
248
|
+
return {
|
|
249
|
+
data: serializers.agents.blocks.list.Response.parseOrThrow(_response.body, {
|
|
250
|
+
unrecognizedObjectKeys: "passthrough",
|
|
251
|
+
allowUnrecognizedUnionMembers: true,
|
|
252
|
+
allowUnrecognizedEnumValues: true,
|
|
253
|
+
skipValidation: true,
|
|
254
|
+
breadcrumbsPrefix: ["response"],
|
|
255
|
+
}),
|
|
256
|
+
rawResponse: _response.rawResponse,
|
|
257
|
+
};
|
|
234
258
|
}
|
|
235
259
|
if (_response.error.reason === "status-code") {
|
|
236
260
|
switch (_response.error.statusCode) {
|
|
@@ -241,11 +265,12 @@ class Blocks {
|
|
|
241
265
|
allowUnrecognizedEnumValues: true,
|
|
242
266
|
skipValidation: true,
|
|
243
267
|
breadcrumbsPrefix: ["response"],
|
|
244
|
-
}));
|
|
268
|
+
}), _response.rawResponse);
|
|
245
269
|
default:
|
|
246
270
|
throw new errors.LettaError({
|
|
247
271
|
statusCode: _response.error.statusCode,
|
|
248
272
|
body: _response.error.body,
|
|
273
|
+
rawResponse: _response.rawResponse,
|
|
249
274
|
});
|
|
250
275
|
}
|
|
251
276
|
}
|
|
@@ -254,12 +279,14 @@ class Blocks {
|
|
|
254
279
|
throw new errors.LettaError({
|
|
255
280
|
statusCode: _response.error.statusCode,
|
|
256
281
|
body: _response.error.rawBody,
|
|
282
|
+
rawResponse: _response.rawResponse,
|
|
257
283
|
});
|
|
258
284
|
case "timeout":
|
|
259
285
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory/blocks.");
|
|
260
286
|
case "unknown":
|
|
261
287
|
throw new errors.LettaError({
|
|
262
288
|
message: _response.error.errorMessage,
|
|
289
|
+
rawResponse: _response.rawResponse,
|
|
263
290
|
});
|
|
264
291
|
}
|
|
265
292
|
});
|
|
@@ -277,6 +304,9 @@ class Blocks {
|
|
|
277
304
|
* await client.agents.blocks.attach("agent_id", "block_id")
|
|
278
305
|
*/
|
|
279
306
|
attach(agentId, blockId, requestOptions) {
|
|
307
|
+
return core.HttpResponsePromise.fromPromise(this.__attach(agentId, blockId, requestOptions));
|
|
308
|
+
}
|
|
309
|
+
__attach(agentId, blockId, requestOptions) {
|
|
280
310
|
return __awaiter(this, void 0, void 0, function* () {
|
|
281
311
|
var _a, _b, _c;
|
|
282
312
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -284,7 +314,7 @@ class Blocks {
|
|
|
284
314
|
method: "PATCH",
|
|
285
315
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
286
316
|
? yield core.Supplier.get(this._options.project)
|
|
287
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
317
|
+
: 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),
|
|
288
318
|
contentType: "application/json",
|
|
289
319
|
requestType: "json",
|
|
290
320
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -292,13 +322,16 @@ class Blocks {
|
|
|
292
322
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
293
323
|
});
|
|
294
324
|
if (_response.ok) {
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
325
|
+
return {
|
|
326
|
+
data: serializers.AgentState.parseOrThrow(_response.body, {
|
|
327
|
+
unrecognizedObjectKeys: "passthrough",
|
|
328
|
+
allowUnrecognizedUnionMembers: true,
|
|
329
|
+
allowUnrecognizedEnumValues: true,
|
|
330
|
+
skipValidation: true,
|
|
331
|
+
breadcrumbsPrefix: ["response"],
|
|
332
|
+
}),
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
};
|
|
302
335
|
}
|
|
303
336
|
if (_response.error.reason === "status-code") {
|
|
304
337
|
switch (_response.error.statusCode) {
|
|
@@ -309,11 +342,12 @@ class Blocks {
|
|
|
309
342
|
allowUnrecognizedEnumValues: true,
|
|
310
343
|
skipValidation: true,
|
|
311
344
|
breadcrumbsPrefix: ["response"],
|
|
312
|
-
}));
|
|
345
|
+
}), _response.rawResponse);
|
|
313
346
|
default:
|
|
314
347
|
throw new errors.LettaError({
|
|
315
348
|
statusCode: _response.error.statusCode,
|
|
316
349
|
body: _response.error.body,
|
|
350
|
+
rawResponse: _response.rawResponse,
|
|
317
351
|
});
|
|
318
352
|
}
|
|
319
353
|
}
|
|
@@ -322,12 +356,14 @@ class Blocks {
|
|
|
322
356
|
throw new errors.LettaError({
|
|
323
357
|
statusCode: _response.error.statusCode,
|
|
324
358
|
body: _response.error.rawBody,
|
|
359
|
+
rawResponse: _response.rawResponse,
|
|
325
360
|
});
|
|
326
361
|
case "timeout":
|
|
327
362
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/attach/{block_id}.");
|
|
328
363
|
case "unknown":
|
|
329
364
|
throw new errors.LettaError({
|
|
330
365
|
message: _response.error.errorMessage,
|
|
366
|
+
rawResponse: _response.rawResponse,
|
|
331
367
|
});
|
|
332
368
|
}
|
|
333
369
|
});
|
|
@@ -345,6 +381,9 @@ class Blocks {
|
|
|
345
381
|
* await client.agents.blocks.detach("agent_id", "block_id")
|
|
346
382
|
*/
|
|
347
383
|
detach(agentId, blockId, requestOptions) {
|
|
384
|
+
return core.HttpResponsePromise.fromPromise(this.__detach(agentId, blockId, requestOptions));
|
|
385
|
+
}
|
|
386
|
+
__detach(agentId, blockId, requestOptions) {
|
|
348
387
|
return __awaiter(this, void 0, void 0, function* () {
|
|
349
388
|
var _a, _b, _c;
|
|
350
389
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -352,7 +391,7 @@ class Blocks {
|
|
|
352
391
|
method: "PATCH",
|
|
353
392
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
354
393
|
? yield core.Supplier.get(this._options.project)
|
|
355
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
394
|
+
: 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),
|
|
356
395
|
contentType: "application/json",
|
|
357
396
|
requestType: "json",
|
|
358
397
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -360,13 +399,16 @@ class Blocks {
|
|
|
360
399
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
361
400
|
});
|
|
362
401
|
if (_response.ok) {
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
402
|
+
return {
|
|
403
|
+
data: serializers.AgentState.parseOrThrow(_response.body, {
|
|
404
|
+
unrecognizedObjectKeys: "passthrough",
|
|
405
|
+
allowUnrecognizedUnionMembers: true,
|
|
406
|
+
allowUnrecognizedEnumValues: true,
|
|
407
|
+
skipValidation: true,
|
|
408
|
+
breadcrumbsPrefix: ["response"],
|
|
409
|
+
}),
|
|
410
|
+
rawResponse: _response.rawResponse,
|
|
411
|
+
};
|
|
370
412
|
}
|
|
371
413
|
if (_response.error.reason === "status-code") {
|
|
372
414
|
switch (_response.error.statusCode) {
|
|
@@ -377,11 +419,12 @@ class Blocks {
|
|
|
377
419
|
allowUnrecognizedEnumValues: true,
|
|
378
420
|
skipValidation: true,
|
|
379
421
|
breadcrumbsPrefix: ["response"],
|
|
380
|
-
}));
|
|
422
|
+
}), _response.rawResponse);
|
|
381
423
|
default:
|
|
382
424
|
throw new errors.LettaError({
|
|
383
425
|
statusCode: _response.error.statusCode,
|
|
384
426
|
body: _response.error.body,
|
|
427
|
+
rawResponse: _response.rawResponse,
|
|
385
428
|
});
|
|
386
429
|
}
|
|
387
430
|
}
|
|
@@ -390,12 +433,14 @@ class Blocks {
|
|
|
390
433
|
throw new errors.LettaError({
|
|
391
434
|
statusCode: _response.error.statusCode,
|
|
392
435
|
body: _response.error.rawBody,
|
|
436
|
+
rawResponse: _response.rawResponse,
|
|
393
437
|
});
|
|
394
438
|
case "timeout":
|
|
395
439
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/core-memory/blocks/detach/{block_id}.");
|
|
396
440
|
case "unknown":
|
|
397
441
|
throw new errors.LettaError({
|
|
398
442
|
message: _response.error.errorMessage,
|
|
443
|
+
rawResponse: _response.rawResponse,
|
|
399
444
|
});
|
|
400
445
|
}
|
|
401
446
|
});
|
|
@@ -41,7 +41,8 @@ export declare class Context {
|
|
|
41
41
|
* @example
|
|
42
42
|
* await client.agents.context.retrieve("agent_id")
|
|
43
43
|
*/
|
|
44
|
-
retrieve(agentId: string, requestOptions?: Context.RequestOptions):
|
|
44
|
+
retrieve(agentId: string, requestOptions?: Context.RequestOptions): core.HttpResponsePromise<Letta.ContextWindowOverview>;
|
|
45
|
+
private __retrieve;
|
|
45
46
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
46
47
|
Authorization: string;
|
|
47
48
|
}>;
|
|
@@ -71,6 +71,9 @@ class Context {
|
|
|
71
71
|
* await client.agents.context.retrieve("agent_id")
|
|
72
72
|
*/
|
|
73
73
|
retrieve(agentId, requestOptions) {
|
|
74
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(agentId, requestOptions));
|
|
75
|
+
}
|
|
76
|
+
__retrieve(agentId, requestOptions) {
|
|
74
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
78
|
var _a, _b, _c;
|
|
76
79
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -78,7 +81,7 @@ class Context {
|
|
|
78
81
|
method: "GET",
|
|
79
82
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
80
83
|
? yield core.Supplier.get(this._options.project)
|
|
81
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
84
|
+
: 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),
|
|
82
85
|
contentType: "application/json",
|
|
83
86
|
requestType: "json",
|
|
84
87
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -86,13 +89,16 @@ class Context {
|
|
|
86
89
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
87
90
|
});
|
|
88
91
|
if (_response.ok) {
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
return {
|
|
93
|
+
data: serializers.ContextWindowOverview.parseOrThrow(_response.body, {
|
|
94
|
+
unrecognizedObjectKeys: "passthrough",
|
|
95
|
+
allowUnrecognizedUnionMembers: true,
|
|
96
|
+
allowUnrecognizedEnumValues: true,
|
|
97
|
+
skipValidation: true,
|
|
98
|
+
breadcrumbsPrefix: ["response"],
|
|
99
|
+
}),
|
|
100
|
+
rawResponse: _response.rawResponse,
|
|
101
|
+
};
|
|
96
102
|
}
|
|
97
103
|
if (_response.error.reason === "status-code") {
|
|
98
104
|
switch (_response.error.statusCode) {
|
|
@@ -103,11 +109,12 @@ class Context {
|
|
|
103
109
|
allowUnrecognizedEnumValues: true,
|
|
104
110
|
skipValidation: true,
|
|
105
111
|
breadcrumbsPrefix: ["response"],
|
|
106
|
-
}));
|
|
112
|
+
}), _response.rawResponse);
|
|
107
113
|
default:
|
|
108
114
|
throw new errors.LettaError({
|
|
109
115
|
statusCode: _response.error.statusCode,
|
|
110
116
|
body: _response.error.body,
|
|
117
|
+
rawResponse: _response.rawResponse,
|
|
111
118
|
});
|
|
112
119
|
}
|
|
113
120
|
}
|
|
@@ -116,12 +123,14 @@ class Context {
|
|
|
116
123
|
throw new errors.LettaError({
|
|
117
124
|
statusCode: _response.error.statusCode,
|
|
118
125
|
body: _response.error.rawBody,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
119
127
|
});
|
|
120
128
|
case "timeout":
|
|
121
129
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/context.");
|
|
122
130
|
case "unknown":
|
|
123
131
|
throw new errors.LettaError({
|
|
124
132
|
message: _response.error.errorMessage,
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
125
134
|
});
|
|
126
135
|
}
|
|
127
136
|
});
|
|
@@ -42,7 +42,8 @@ export declare class CoreMemory {
|
|
|
42
42
|
* @example
|
|
43
43
|
* await client.agents.coreMemory.retrieve("agent_id")
|
|
44
44
|
*/
|
|
45
|
-
retrieve(agentId: string, requestOptions?: CoreMemory.RequestOptions):
|
|
45
|
+
retrieve(agentId: string, requestOptions?: CoreMemory.RequestOptions): core.HttpResponsePromise<Letta.Memory>;
|
|
46
|
+
private __retrieve;
|
|
46
47
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
47
48
|
Authorization: string;
|
|
48
49
|
}>;
|
|
@@ -72,6 +72,9 @@ class CoreMemory {
|
|
|
72
72
|
* await client.agents.coreMemory.retrieve("agent_id")
|
|
73
73
|
*/
|
|
74
74
|
retrieve(agentId, requestOptions) {
|
|
75
|
+
return core.HttpResponsePromise.fromPromise(this.__retrieve(agentId, requestOptions));
|
|
76
|
+
}
|
|
77
|
+
__retrieve(agentId, requestOptions) {
|
|
75
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
79
|
var _a, _b, _c;
|
|
77
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -79,7 +82,7 @@ class CoreMemory {
|
|
|
79
82
|
method: "GET",
|
|
80
83
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
84
|
? yield core.Supplier.get(this._options.project)
|
|
82
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
85
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.172", "User-Agent": "@letta-ai/letta-client/0.1.172", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
83
86
|
contentType: "application/json",
|
|
84
87
|
requestType: "json",
|
|
85
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -87,13 +90,16 @@ class CoreMemory {
|
|
|
87
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
91
|
});
|
|
89
92
|
if (_response.ok) {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
return {
|
|
94
|
+
data: serializers.Memory.parseOrThrow(_response.body, {
|
|
95
|
+
unrecognizedObjectKeys: "passthrough",
|
|
96
|
+
allowUnrecognizedUnionMembers: true,
|
|
97
|
+
allowUnrecognizedEnumValues: true,
|
|
98
|
+
skipValidation: true,
|
|
99
|
+
breadcrumbsPrefix: ["response"],
|
|
100
|
+
}),
|
|
101
|
+
rawResponse: _response.rawResponse,
|
|
102
|
+
};
|
|
97
103
|
}
|
|
98
104
|
if (_response.error.reason === "status-code") {
|
|
99
105
|
switch (_response.error.statusCode) {
|
|
@@ -104,11 +110,12 @@ class CoreMemory {
|
|
|
104
110
|
allowUnrecognizedEnumValues: true,
|
|
105
111
|
skipValidation: true,
|
|
106
112
|
breadcrumbsPrefix: ["response"],
|
|
107
|
-
}));
|
|
113
|
+
}), _response.rawResponse);
|
|
108
114
|
default:
|
|
109
115
|
throw new errors.LettaError({
|
|
110
116
|
statusCode: _response.error.statusCode,
|
|
111
117
|
body: _response.error.body,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
112
119
|
});
|
|
113
120
|
}
|
|
114
121
|
}
|
|
@@ -117,12 +124,14 @@ class CoreMemory {
|
|
|
117
124
|
throw new errors.LettaError({
|
|
118
125
|
statusCode: _response.error.statusCode,
|
|
119
126
|
body: _response.error.rawBody,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
120
128
|
});
|
|
121
129
|
case "timeout":
|
|
122
130
|
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/core-memory.");
|
|
123
131
|
case "unknown":
|
|
124
132
|
throw new errors.LettaError({
|
|
125
133
|
message: _response.error.errorMessage,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
126
135
|
});
|
|
127
136
|
}
|
|
128
137
|
});
|
|
@@ -43,7 +43,8 @@ export declare class Files {
|
|
|
43
43
|
* @example
|
|
44
44
|
* await client.agents.files.closeAll("agent_id")
|
|
45
45
|
*/
|
|
46
|
-
closeAll(agentId: string, requestOptions?: Files.RequestOptions):
|
|
46
|
+
closeAll(agentId: string, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
47
|
+
private __closeAll;
|
|
47
48
|
/**
|
|
48
49
|
* Opens a specific file for a given agent.
|
|
49
50
|
*
|
|
@@ -60,7 +61,8 @@ export declare class Files {
|
|
|
60
61
|
* @example
|
|
61
62
|
* await client.agents.files.open("agent_id", "file_id")
|
|
62
63
|
*/
|
|
63
|
-
open(agentId: string, fileId: string, requestOptions?: Files.RequestOptions):
|
|
64
|
+
open(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
65
|
+
private __open;
|
|
64
66
|
/**
|
|
65
67
|
* Closes a specific file for a given agent.
|
|
66
68
|
*
|
|
@@ -76,7 +78,8 @@ export declare class Files {
|
|
|
76
78
|
* @example
|
|
77
79
|
* await client.agents.files.close("agent_id", "file_id")
|
|
78
80
|
*/
|
|
79
|
-
close(agentId: string, fileId: string, requestOptions?: Files.RequestOptions):
|
|
81
|
+
close(agentId: string, fileId: string, requestOptions?: Files.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
82
|
+
private __close;
|
|
80
83
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
81
84
|
Authorization: string;
|
|
82
85
|
}>;
|