@letta-ai/letta-client 0.1.148 → 0.1.151
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/api/resources/agents/client/Client.d.ts +0 -15
- package/api/resources/agents/client/Client.js +11 -86
- package/api/resources/agents/resources/blocks/client/Client.d.ts +1 -1
- package/api/resources/agents/resources/blocks/client/Client.js +6 -6
- package/api/resources/agents/resources/context/client/Client.js +1 -1
- package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/api/resources/agents/resources/groups/client/Client.js +1 -1
- package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/api/resources/agents/resources/messages/client/Client.d.ts +40 -0
- package/api/resources/agents/resources/messages/client/Client.js +164 -6
- package/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +5 -0
- package/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +5 -0
- package/api/resources/agents/resources/messages/types/index.d.ts +1 -0
- package/api/resources/agents/resources/messages/types/index.js +1 -0
- package/api/resources/agents/resources/passages/client/Client.js +4 -4
- package/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/api/resources/batches/client/Client.js +4 -4
- package/api/resources/blocks/client/Client.js +6 -6
- package/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
- package/api/resources/blocks/resources/agents/client/Client.js +15 -3
- package/api/resources/blocks/resources/agents/client/index.d.ts +1 -1
- package/api/resources/blocks/resources/agents/client/index.js +15 -0
- package/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.d.ts +13 -0
- package/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.js +5 -0
- package/api/resources/blocks/resources/agents/client/requests/index.d.ts +1 -0
- package/api/resources/blocks/resources/agents/client/requests/index.js +2 -0
- package/api/resources/blocks/resources/index.d.ts +1 -0
- package/api/resources/blocks/resources/index.js +4 -0
- package/api/resources/clientSideAccessTokens/client/Client.d.ts +12 -0
- package/api/resources/clientSideAccessTokens/client/Client.js +76 -3
- package/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.d.ts +21 -0
- package/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.js +5 -0
- package/api/resources/clientSideAccessTokens/client/requests/index.d.ts +1 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +8 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +5 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +10 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +5 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +8 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +5 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +9 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +5 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
- package/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +12 -0
- package/api/resources/clientSideAccessTokens/types/index.d.ts +5 -0
- package/api/resources/clientSideAccessTokens/types/index.js +5 -0
- package/api/resources/embeddingModels/client/Client.js +1 -1
- package/api/resources/groups/client/Client.js +6 -6
- package/api/resources/groups/resources/messages/client/Client.js +5 -5
- package/api/resources/health/client/Client.js +1 -1
- package/api/resources/identities/client/Client.js +7 -7
- package/api/resources/identities/resources/properties/client/Client.js +1 -1
- package/api/resources/jobs/client/Client.js +5 -5
- package/api/resources/messages/client/Client.js +1 -1
- package/api/resources/models/client/Client.js +1 -1
- package/api/resources/projects/client/Client.js +1 -1
- package/api/resources/providers/client/Client.js +5 -5
- package/api/resources/runs/client/Client.js +4 -4
- package/api/resources/runs/resources/messages/client/Client.js +1 -1
- package/api/resources/runs/resources/steps/client/Client.js +1 -1
- package/api/resources/runs/resources/usage/client/Client.js +1 -1
- package/api/resources/sources/client/Client.d.ts +18 -0
- package/api/resources/sources/client/Client.js +87 -8
- package/api/resources/sources/client/requests/GetSourcesMetadataRequest.d.ts +10 -0
- package/api/resources/sources/client/requests/GetSourcesMetadataRequest.js +5 -0
- package/api/resources/sources/client/requests/SourceCreate.d.ts +6 -6
- package/api/resources/sources/client/requests/index.d.ts +1 -0
- package/api/resources/sources/resources/files/client/Client.d.ts +3 -2
- package/api/resources/sources/resources/files/client/Client.js +11 -5
- package/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +5 -0
- package/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/api/resources/steps/client/Client.js +2 -2
- package/api/resources/steps/resources/feedback/client/Client.js +1 -1
- package/api/resources/tags/client/Client.js +1 -1
- package/api/resources/telemetry/client/Client.js +1 -1
- package/api/resources/templates/client/Client.js +1 -1
- package/api/resources/templates/resources/agents/client/Client.js +1 -1
- package/api/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -0
- package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +13 -0
- package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +5 -0
- package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +9 -0
- package/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +11 -0
- package/api/resources/templates/resources/agents/types/index.d.ts +2 -0
- package/api/resources/templates/resources/agents/types/index.js +2 -0
- package/api/resources/tools/client/Client.js +19 -19
- package/api/resources/tools/types/UpdateMcpServerRequest.d.ts +1 -1
- package/api/resources/voice/client/Client.js +1 -1
- package/api/types/DuplicateFileHandling.d.ts +12 -0
- package/api/types/DuplicateFileHandling.js +11 -0
- package/api/types/FileMetadata.d.ts +8 -4
- package/api/types/FileStats.d.ts +14 -0
- package/api/types/FileStats.js +5 -0
- package/api/types/LlmConfig.d.ts +2 -0
- package/api/types/Message.d.ts +18 -17
- package/api/types/OrganizationSourcesStats.d.ts +17 -0
- package/api/types/OrganizationSourcesStats.js +5 -0
- package/api/types/Source.d.ts +4 -4
- package/api/types/SourceStats.d.ts +19 -0
- package/api/types/SourceStats.js +5 -0
- package/api/types/UpdateStdioMcpServer.d.ts +13 -0
- package/api/types/UpdateStdioMcpServer.js +5 -0
- package/api/types/index.d.ts +5 -0
- package/api/types/index.js +5 -0
- package/dist/api/resources/agents/client/Client.d.ts +0 -15
- package/dist/api/resources/agents/client/Client.js +11 -86
- package/dist/api/resources/agents/resources/blocks/client/Client.d.ts +1 -1
- package/dist/api/resources/agents/resources/blocks/client/Client.js +6 -6
- package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
- package/dist/api/resources/agents/resources/messages/client/Client.d.ts +40 -0
- package/dist/api/resources/agents/resources/messages/client/Client.js +164 -6
- package/dist/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +5 -0
- package/dist/api/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +5 -0
- package/dist/api/resources/agents/resources/messages/types/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/messages/types/index.js +1 -0
- package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
- package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
- package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
- package/dist/api/resources/batches/client/Client.js +4 -4
- package/dist/api/resources/blocks/client/Client.js +6 -6
- package/dist/api/resources/blocks/resources/agents/client/Client.d.ts +2 -1
- package/dist/api/resources/blocks/resources/agents/client/Client.js +15 -3
- package/dist/api/resources/blocks/resources/agents/client/index.d.ts +1 -1
- package/dist/api/resources/blocks/resources/agents/client/index.js +15 -0
- package/dist/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.d.ts +13 -0
- package/dist/api/resources/blocks/resources/agents/client/requests/AgentsListRequest.js +5 -0
- package/dist/api/resources/blocks/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/api/resources/blocks/resources/agents/client/requests/index.js +2 -0
- package/dist/api/resources/blocks/resources/index.d.ts +1 -0
- package/dist/api/resources/blocks/resources/index.js +4 -0
- package/dist/api/resources/clientSideAccessTokens/client/Client.d.ts +12 -0
- package/dist/api/resources/clientSideAccessTokens/client/Client.js +76 -3
- package/dist/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.d.ts +21 -0
- package/dist/api/resources/clientSideAccessTokens/client/requests/ClientSideAccessTokensListClientSideAccessTokensRequest.js +5 -0
- package/dist/api/resources/clientSideAccessTokens/client/requests/index.d.ts +1 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +8 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +5 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +10 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +5 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +8 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +5 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +9 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +5 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
- package/dist/api/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +12 -0
- package/dist/api/resources/clientSideAccessTokens/types/index.d.ts +5 -0
- package/dist/api/resources/clientSideAccessTokens/types/index.js +5 -0
- package/dist/api/resources/embeddingModels/client/Client.js +1 -1
- package/dist/api/resources/groups/client/Client.js +6 -6
- package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
- package/dist/api/resources/health/client/Client.js +1 -1
- package/dist/api/resources/identities/client/Client.js +7 -7
- package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
- package/dist/api/resources/jobs/client/Client.js +5 -5
- package/dist/api/resources/messages/client/Client.js +1 -1
- package/dist/api/resources/models/client/Client.js +1 -1
- package/dist/api/resources/projects/client/Client.js +1 -1
- package/dist/api/resources/providers/client/Client.js +5 -5
- package/dist/api/resources/runs/client/Client.js +4 -4
- package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
- package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
- package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
- package/dist/api/resources/sources/client/Client.d.ts +18 -0
- package/dist/api/resources/sources/client/Client.js +87 -8
- package/dist/api/resources/sources/client/requests/GetSourcesMetadataRequest.d.ts +10 -0
- package/dist/api/resources/sources/client/requests/GetSourcesMetadataRequest.js +5 -0
- package/dist/api/resources/sources/client/requests/SourceCreate.d.ts +6 -6
- package/dist/api/resources/sources/client/requests/index.d.ts +1 -0
- package/dist/api/resources/sources/resources/files/client/Client.d.ts +3 -2
- package/dist/api/resources/sources/resources/files/client/Client.js +11 -5
- package/dist/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +5 -0
- package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
- package/dist/api/resources/steps/client/Client.js +2 -2
- package/dist/api/resources/steps/resources/feedback/client/Client.js +1 -1
- package/dist/api/resources/tags/client/Client.js +1 -1
- package/dist/api/resources/telemetry/client/Client.js +1 -1
- package/dist/api/resources/templates/client/Client.js +1 -1
- package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
- package/dist/api/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -0
- package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +13 -0
- package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +5 -0
- package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +9 -0
- package/dist/api/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +11 -0
- package/dist/api/resources/templates/resources/agents/types/index.d.ts +2 -0
- package/dist/api/resources/templates/resources/agents/types/index.js +2 -0
- package/dist/api/resources/tools/client/Client.js +19 -19
- package/dist/api/resources/tools/types/UpdateMcpServerRequest.d.ts +1 -1
- package/dist/api/resources/voice/client/Client.js +1 -1
- package/dist/api/types/DuplicateFileHandling.d.ts +12 -0
- package/dist/api/types/DuplicateFileHandling.js +11 -0
- package/dist/api/types/FileMetadata.d.ts +8 -4
- package/dist/api/types/FileStats.d.ts +14 -0
- package/dist/api/types/FileStats.js +5 -0
- package/dist/api/types/LlmConfig.d.ts +2 -0
- package/dist/api/types/Message.d.ts +18 -17
- package/dist/api/types/OrganizationSourcesStats.d.ts +17 -0
- package/dist/api/types/OrganizationSourcesStats.js +5 -0
- package/dist/api/types/Source.d.ts +4 -4
- package/dist/api/types/SourceStats.d.ts +19 -0
- package/dist/api/types/SourceStats.js +5 -0
- package/dist/api/types/UpdateStdioMcpServer.d.ts +13 -0
- package/dist/api/types/UpdateStdioMcpServer.js +5 -0
- package/dist/api/types/index.d.ts +5 -0
- package/dist/api/types/index.js +5 -0
- package/dist/serialization/resources/agents/client/index.d.ts +0 -1
- package/dist/serialization/resources/agents/client/index.js +1 -2
- package/dist/serialization/resources/agents/{client/cancelAgentRun.d.ts → resources/messages/client/cancel.d.ts} +4 -4
- package/dist/serialization/resources/agents/{client/cancelAgentRun.js → resources/messages/client/cancel.js} +1 -1
- package/dist/serialization/resources/agents/resources/messages/client/index.d.ts +2 -0
- package/dist/serialization/resources/agents/resources/messages/client/index.js +3 -1
- package/dist/serialization/resources/agents/resources/messages/client/previewRawPayload.d.ts +9 -0
- package/dist/serialization/resources/agents/resources/messages/client/previewRawPayload.js +41 -0
- package/dist/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +12 -0
- package/dist/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +43 -0
- package/dist/serialization/resources/agents/resources/messages/types/index.d.ts +1 -0
- package/dist/serialization/resources/agents/resources/messages/types/index.js +1 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +14 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +45 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +16 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +47 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +14 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +45 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +15 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +46 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +41 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/index.d.ts +5 -0
- package/dist/serialization/resources/clientSideAccessTokens/types/index.js +5 -0
- package/dist/serialization/resources/sources/client/requests/SourceCreate.d.ts +3 -3
- package/dist/serialization/resources/sources/client/requests/SourceCreate.js +3 -3
- package/dist/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +2 -0
- package/dist/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.js +2 -0
- package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +19 -0
- package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +50 -0
- package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +10 -0
- package/dist/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +41 -0
- package/dist/serialization/resources/templates/resources/agents/types/index.d.ts +2 -0
- package/dist/serialization/resources/templates/resources/agents/types/index.js +2 -0
- package/dist/serialization/resources/tools/types/UpdateMcpServerRequest.d.ts +2 -1
- package/dist/serialization/resources/tools/types/UpdateMcpServerRequest.js +2 -1
- package/dist/serialization/types/DuplicateFileHandling.d.ts +10 -0
- package/dist/serialization/types/DuplicateFileHandling.js +41 -0
- package/dist/serialization/types/FileMetadata.d.ts +4 -2
- package/dist/serialization/types/FileMetadata.js +4 -2
- package/dist/serialization/types/FileStats.d.ts +14 -0
- package/dist/serialization/types/FileStats.js +45 -0
- package/dist/serialization/types/LlmConfig.d.ts +1 -0
- package/dist/serialization/types/LlmConfig.js +1 -0
- package/dist/serialization/types/OrganizationSourcesStats.d.ts +16 -0
- package/dist/serialization/types/OrganizationSourcesStats.js +47 -0
- package/dist/serialization/types/Source.d.ts +2 -2
- package/dist/serialization/types/Source.js +2 -2
- package/dist/serialization/types/SourceStats.d.ts +17 -0
- package/dist/serialization/types/SourceStats.js +48 -0
- package/dist/serialization/types/UpdateStdioMcpServer.d.ts +14 -0
- package/dist/serialization/types/UpdateStdioMcpServer.js +45 -0
- package/dist/serialization/types/index.d.ts +5 -0
- package/dist/serialization/types/index.js +5 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +312 -77
- package/serialization/resources/agents/client/index.d.ts +0 -1
- package/serialization/resources/agents/client/index.js +1 -2
- package/serialization/resources/agents/{client/cancelAgentRun.d.ts → resources/messages/client/cancel.d.ts} +4 -4
- package/serialization/resources/agents/{client/cancelAgentRun.js → resources/messages/client/cancel.js} +1 -1
- package/serialization/resources/agents/resources/messages/client/index.d.ts +2 -0
- package/serialization/resources/agents/resources/messages/client/index.js +3 -1
- package/serialization/resources/agents/resources/messages/client/previewRawPayload.d.ts +9 -0
- package/serialization/resources/agents/resources/messages/client/previewRawPayload.js +41 -0
- package/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.d.ts +12 -0
- package/serialization/resources/agents/resources/messages/types/MessagesPreviewRawPayloadRequest.js +43 -0
- package/serialization/resources/agents/resources/messages/types/index.d.ts +1 -0
- package/serialization/resources/agents/resources/messages/types/index.js +1 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.d.ts +14 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponse.js +45 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.d.ts +16 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem.js +47 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.d.ts +14 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy.js +45 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.d.ts +15 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem.js +46 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.d.ts +10 -0
- package/serialization/resources/clientSideAccessTokens/types/ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem.js +41 -0
- package/serialization/resources/clientSideAccessTokens/types/index.d.ts +5 -0
- package/serialization/resources/clientSideAccessTokens/types/index.js +5 -0
- package/serialization/resources/sources/client/requests/SourceCreate.d.ts +3 -3
- package/serialization/resources/sources/client/requests/SourceCreate.js +3 -3
- package/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.d.ts +2 -0
- package/serialization/resources/templates/resources/agents/client/requests/AgentsCreateRequest.js +2 -0
- package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.d.ts +19 -0
- package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItem.js +50 -0
- package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.d.ts +10 -0
- package/serialization/resources/templates/resources/agents/types/AgentsCreateRequestInitialMessageSequenceItemRole.js +41 -0
- package/serialization/resources/templates/resources/agents/types/index.d.ts +2 -0
- package/serialization/resources/templates/resources/agents/types/index.js +2 -0
- package/serialization/resources/tools/types/UpdateMcpServerRequest.d.ts +2 -1
- package/serialization/resources/tools/types/UpdateMcpServerRequest.js +2 -1
- package/serialization/types/DuplicateFileHandling.d.ts +10 -0
- package/serialization/types/DuplicateFileHandling.js +41 -0
- package/serialization/types/FileMetadata.d.ts +4 -2
- package/serialization/types/FileMetadata.js +4 -2
- package/serialization/types/FileStats.d.ts +14 -0
- package/serialization/types/FileStats.js +45 -0
- package/serialization/types/LlmConfig.d.ts +1 -0
- package/serialization/types/LlmConfig.js +1 -0
- package/serialization/types/OrganizationSourcesStats.d.ts +16 -0
- package/serialization/types/OrganizationSourcesStats.js +47 -0
- package/serialization/types/Source.d.ts +2 -2
- package/serialization/types/Source.js +2 -2
- package/serialization/types/SourceStats.d.ts +17 -0
- package/serialization/types/SourceStats.js +48 -0
- package/serialization/types/UpdateStdioMcpServer.d.ts +14 -0
- package/serialization/types/UpdateStdioMcpServer.js +45 -0
- package/serialization/types/index.d.ts +5 -0
- package/serialization/types/index.js +5 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -178,21 +178,6 @@ export declare class Agents {
|
|
|
178
178
|
* await client.agents.closeAllOpenFiles("agent_id")
|
|
179
179
|
*/
|
|
180
180
|
closeAllOpenFiles(agentId: string, requestOptions?: Agents.RequestOptions): Promise<string[]>;
|
|
181
|
-
/**
|
|
182
|
-
* Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
|
|
183
|
-
*
|
|
184
|
-
* Note to cancel active runs associated with an agent, redis is required.
|
|
185
|
-
*
|
|
186
|
-
* @param {string} agentId
|
|
187
|
-
* @param {string[]} request
|
|
188
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
189
|
-
*
|
|
190
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* await client.agents.cancelAgentRun("agent_id", undefined)
|
|
194
|
-
*/
|
|
195
|
-
cancelAgentRun(agentId: string, request?: string[], requestOptions?: Agents.RequestOptions): Promise<Record<string, unknown>>;
|
|
196
181
|
/**
|
|
197
182
|
* Summarize an agent's conversation history to a target message length.
|
|
198
183
|
*
|
|
@@ -193,7 +193,7 @@ class Agents {
|
|
|
193
193
|
method: "GET",
|
|
194
194
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
195
195
|
? yield core.Supplier.get(this._options.project)
|
|
196
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
196
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
197
197
|
contentType: "application/json",
|
|
198
198
|
queryParameters: _queryParams,
|
|
199
199
|
requestType: "json",
|
|
@@ -261,7 +261,7 @@ class Agents {
|
|
|
261
261
|
method: "POST",
|
|
262
262
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
263
263
|
? yield core.Supplier.get(this._options.project)
|
|
264
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
264
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
265
265
|
contentType: "application/json",
|
|
266
266
|
requestType: "json",
|
|
267
267
|
body: serializers.CreateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -328,7 +328,7 @@ class Agents {
|
|
|
328
328
|
method: "GET",
|
|
329
329
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
330
330
|
? yield core.Supplier.get(this._options.project)
|
|
331
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
331
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
332
332
|
contentType: "application/json",
|
|
333
333
|
requestType: "json",
|
|
334
334
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -395,7 +395,7 @@ class Agents {
|
|
|
395
395
|
method: "GET",
|
|
396
396
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
397
397
|
? yield core.Supplier.get(this._options.project)
|
|
398
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
398
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
399
399
|
contentType: "application/json",
|
|
400
400
|
requestType: "json",
|
|
401
401
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -479,7 +479,7 @@ class Agents {
|
|
|
479
479
|
method: "POST",
|
|
480
480
|
headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
481
481
|
? yield core.Supplier.get(this._options.project)
|
|
482
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
482
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
483
483
|
queryParameters: _queryParams,
|
|
484
484
|
requestType: "file",
|
|
485
485
|
duplex: _maybeEncodedRequest.duplex,
|
|
@@ -559,7 +559,7 @@ class Agents {
|
|
|
559
559
|
method: "GET",
|
|
560
560
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
561
561
|
? yield core.Supplier.get(this._options.project)
|
|
562
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
562
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
563
563
|
contentType: "application/json",
|
|
564
564
|
queryParameters: _queryParams,
|
|
565
565
|
requestType: "json",
|
|
@@ -627,7 +627,7 @@ class Agents {
|
|
|
627
627
|
method: "DELETE",
|
|
628
628
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
629
629
|
? yield core.Supplier.get(this._options.project)
|
|
630
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
630
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
631
631
|
contentType: "application/json",
|
|
632
632
|
requestType: "json",
|
|
633
633
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -689,7 +689,7 @@ class Agents {
|
|
|
689
689
|
method: "PATCH",
|
|
690
690
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
691
691
|
? yield core.Supplier.get(this._options.project)
|
|
692
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
692
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
693
693
|
contentType: "application/json",
|
|
694
694
|
requestType: "json",
|
|
695
695
|
body: serializers.UpdateAgent.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -760,7 +760,7 @@ class Agents {
|
|
|
760
760
|
method: "PATCH",
|
|
761
761
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
762
762
|
? yield core.Supplier.get(this._options.project)
|
|
763
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
763
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
764
764
|
contentType: "application/json",
|
|
765
765
|
requestType: "json",
|
|
766
766
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -808,81 +808,6 @@ class Agents {
|
|
|
808
808
|
}
|
|
809
809
|
});
|
|
810
810
|
}
|
|
811
|
-
/**
|
|
812
|
-
* Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
|
|
813
|
-
*
|
|
814
|
-
* Note to cancel active runs associated with an agent, redis is required.
|
|
815
|
-
*
|
|
816
|
-
* @param {string} agentId
|
|
817
|
-
* @param {string[]} request
|
|
818
|
-
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
819
|
-
*
|
|
820
|
-
* @throws {@link Letta.UnprocessableEntityError}
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* await client.agents.cancelAgentRun("agent_id", undefined)
|
|
824
|
-
*/
|
|
825
|
-
cancelAgentRun(agentId, request, requestOptions) {
|
|
826
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
827
|
-
var _a, _b, _c;
|
|
828
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
829
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/cancel`),
|
|
830
|
-
method: "POST",
|
|
831
|
-
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
832
|
-
? yield core.Supplier.get(this._options.project)
|
|
833
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.148", "User-Agent": "@letta-ai/letta-client/0.1.148", "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),
|
|
834
|
-
contentType: "application/json",
|
|
835
|
-
requestType: "json",
|
|
836
|
-
body: request != null
|
|
837
|
-
? serializers.agents.cancelAgentRun.Request.jsonOrThrow(request, {
|
|
838
|
-
unrecognizedObjectKeys: "strip",
|
|
839
|
-
})
|
|
840
|
-
: undefined,
|
|
841
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
842
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
843
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
844
|
-
});
|
|
845
|
-
if (_response.ok) {
|
|
846
|
-
return serializers.agents.cancelAgentRun.Response.parseOrThrow(_response.body, {
|
|
847
|
-
unrecognizedObjectKeys: "passthrough",
|
|
848
|
-
allowUnrecognizedUnionMembers: true,
|
|
849
|
-
allowUnrecognizedEnumValues: true,
|
|
850
|
-
skipValidation: true,
|
|
851
|
-
breadcrumbsPrefix: ["response"],
|
|
852
|
-
});
|
|
853
|
-
}
|
|
854
|
-
if (_response.error.reason === "status-code") {
|
|
855
|
-
switch (_response.error.statusCode) {
|
|
856
|
-
case 422:
|
|
857
|
-
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
858
|
-
unrecognizedObjectKeys: "passthrough",
|
|
859
|
-
allowUnrecognizedUnionMembers: true,
|
|
860
|
-
allowUnrecognizedEnumValues: true,
|
|
861
|
-
skipValidation: true,
|
|
862
|
-
breadcrumbsPrefix: ["response"],
|
|
863
|
-
}));
|
|
864
|
-
default:
|
|
865
|
-
throw new errors.LettaError({
|
|
866
|
-
statusCode: _response.error.statusCode,
|
|
867
|
-
body: _response.error.body,
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
switch (_response.error.reason) {
|
|
872
|
-
case "non-json":
|
|
873
|
-
throw new errors.LettaError({
|
|
874
|
-
statusCode: _response.error.statusCode,
|
|
875
|
-
body: _response.error.rawBody,
|
|
876
|
-
});
|
|
877
|
-
case "timeout":
|
|
878
|
-
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/cancel.");
|
|
879
|
-
case "unknown":
|
|
880
|
-
throw new errors.LettaError({
|
|
881
|
-
message: _response.error.errorMessage,
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
811
|
/**
|
|
887
812
|
* Summarize an agent's conversation history to a target message length.
|
|
888
813
|
*
|
|
@@ -911,7 +836,7 @@ class Agents {
|
|
|
911
836
|
method: "POST",
|
|
912
837
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
913
838
|
? yield core.Supplier.get(this._options.project)
|
|
914
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
839
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
915
840
|
contentType: "application/json",
|
|
916
841
|
queryParameters: _queryParams,
|
|
917
842
|
requestType: "json",
|
|
@@ -979,7 +904,7 @@ class Agents {
|
|
|
979
904
|
method: "POST",
|
|
980
905
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
981
906
|
? yield core.Supplier.get(this._options.project)
|
|
982
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
907
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
983
908
|
contentType: "application/json",
|
|
984
909
|
requestType: "json",
|
|
985
910
|
body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -70,7 +70,7 @@ export declare class Blocks {
|
|
|
70
70
|
*/
|
|
71
71
|
list(agentId: string, requestOptions?: Blocks.RequestOptions): Promise<Letta.Block[]>;
|
|
72
72
|
/**
|
|
73
|
-
* Attach a core
|
|
73
|
+
* Attach a core memory block to an agent.
|
|
74
74
|
*
|
|
75
75
|
* @param {string} agentId
|
|
76
76
|
* @param {string} blockId
|
|
@@ -79,7 +79,7 @@ class Blocks {
|
|
|
79
79
|
method: "GET",
|
|
80
80
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
81
|
? 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.
|
|
82
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
83
|
contentType: "application/json",
|
|
84
84
|
requestType: "json",
|
|
85
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -148,7 +148,7 @@ class Blocks {
|
|
|
148
148
|
method: "PATCH",
|
|
149
149
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
150
150
|
? 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.
|
|
151
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
152
|
contentType: "application/json",
|
|
153
153
|
requestType: "json",
|
|
154
154
|
body: serializers.BlockUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -216,7 +216,7 @@ class Blocks {
|
|
|
216
216
|
method: "GET",
|
|
217
217
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
218
218
|
? 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.
|
|
219
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
220
|
contentType: "application/json",
|
|
221
221
|
requestType: "json",
|
|
222
222
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -265,7 +265,7 @@ class Blocks {
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
|
-
* Attach a core
|
|
268
|
+
* Attach a core memory block to an agent.
|
|
269
269
|
*
|
|
270
270
|
* @param {string} agentId
|
|
271
271
|
* @param {string} blockId
|
|
@@ -284,7 +284,7 @@ class Blocks {
|
|
|
284
284
|
method: "PATCH",
|
|
285
285
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
286
286
|
? 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.
|
|
287
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
288
|
contentType: "application/json",
|
|
289
289
|
requestType: "json",
|
|
290
290
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -352,7 +352,7 @@ class Blocks {
|
|
|
352
352
|
method: "PATCH",
|
|
353
353
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
354
354
|
? 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.
|
|
355
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
356
|
contentType: "application/json",
|
|
357
357
|
requestType: "json",
|
|
358
358
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -78,7 +78,7 @@ class Context {
|
|
|
78
78
|
method: "GET",
|
|
79
79
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
80
80
|
? 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.
|
|
81
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -79,7 +79,7 @@ class CoreMemory {
|
|
|
79
79
|
method: "GET",
|
|
80
80
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
81
81
|
? 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.
|
|
82
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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
83
|
contentType: "application/json",
|
|
84
84
|
requestType: "json",
|
|
85
85
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -84,7 +84,7 @@ class Groups {
|
|
|
84
84
|
method: "GET",
|
|
85
85
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
86
86
|
? yield core.Supplier.get(this._options.project)
|
|
87
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
87
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
88
88
|
contentType: "application/json",
|
|
89
89
|
queryParameters: _queryParams,
|
|
90
90
|
requestType: "json",
|
|
@@ -80,7 +80,7 @@ class MemoryVariables {
|
|
|
80
80
|
method: "GET",
|
|
81
81
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
82
82
|
? yield core.Supplier.get(this._options.project)
|
|
83
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
83
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
84
84
|
contentType: "application/json",
|
|
85
85
|
requestType: "json",
|
|
86
86
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -87,6 +87,21 @@ export declare class Messages {
|
|
|
87
87
|
* It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
|
|
88
88
|
*/
|
|
89
89
|
createStream(agentId: string, request: Letta.LettaStreamingRequest, requestOptions?: Messages.RequestOptions): Promise<core.Stream<Letta.agents.LettaStreamingResponse>>;
|
|
90
|
+
/**
|
|
91
|
+
* Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
|
|
92
|
+
*
|
|
93
|
+
* Note to cancel active runs associated with an agent, redis is required.
|
|
94
|
+
*
|
|
95
|
+
* @param {string} agentId
|
|
96
|
+
* @param {string[]} request
|
|
97
|
+
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* await client.agents.messages.cancel("agent_id", undefined)
|
|
103
|
+
*/
|
|
104
|
+
cancel(agentId: string, request?: string[], requestOptions?: Messages.RequestOptions): Promise<Record<string, unknown>>;
|
|
90
105
|
/**
|
|
91
106
|
* Asynchronously process a user message and return a run object.
|
|
92
107
|
* The actual processing happens in the background, and the status can be checked using the run ID.
|
|
@@ -125,6 +140,31 @@ export declare class Messages {
|
|
|
125
140
|
* await client.agents.messages.reset("agent_id")
|
|
126
141
|
*/
|
|
127
142
|
reset(agentId: string, request?: Letta.agents.MessagesResetRequest, requestOptions?: Messages.RequestOptions): Promise<Letta.AgentState>;
|
|
143
|
+
/**
|
|
144
|
+
* Inspect the raw LLM request payload without sending it.
|
|
145
|
+
*
|
|
146
|
+
* This endpoint processes the message through the agent loop up until
|
|
147
|
+
* the LLM request, then returns the raw request payload that would
|
|
148
|
+
* be sent to the LLM provider. Useful for debugging and inspection.
|
|
149
|
+
*
|
|
150
|
+
* @param {string} agentId
|
|
151
|
+
* @param {Letta.agents.MessagesPreviewRawPayloadRequest} request
|
|
152
|
+
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
153
|
+
*
|
|
154
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* await client.agents.messages.previewRawPayload("agent_id", {
|
|
158
|
+
* messages: [{
|
|
159
|
+
* role: "user",
|
|
160
|
+
* content: [{
|
|
161
|
+
* type: "text",
|
|
162
|
+
* text: "text"
|
|
163
|
+
* }]
|
|
164
|
+
* }]
|
|
165
|
+
* })
|
|
166
|
+
*/
|
|
167
|
+
previewRawPayload(agentId: string, request: Letta.agents.MessagesPreviewRawPayloadRequest, requestOptions?: Messages.RequestOptions): Promise<Record<string, unknown>>;
|
|
128
168
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
129
169
|
Authorization: string;
|
|
130
170
|
}>;
|
|
@@ -102,7 +102,7 @@ class Messages {
|
|
|
102
102
|
method: "GET",
|
|
103
103
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
104
104
|
? yield core.Supplier.get(this._options.project)
|
|
105
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
105
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
106
106
|
contentType: "application/json",
|
|
107
107
|
queryParameters: _queryParams,
|
|
108
108
|
requestType: "json",
|
|
@@ -180,7 +180,7 @@ class Messages {
|
|
|
180
180
|
method: "POST",
|
|
181
181
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
182
182
|
? yield core.Supplier.get(this._options.project)
|
|
183
|
-
: 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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
184
184
|
contentType: "application/json",
|
|
185
185
|
requestType: "json",
|
|
186
186
|
body: serializers.LettaRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -252,7 +252,7 @@ class Messages {
|
|
|
252
252
|
method: "PATCH",
|
|
253
253
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
254
254
|
? yield core.Supplier.get(this._options.project)
|
|
255
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
255
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
256
256
|
contentType: "application/json",
|
|
257
257
|
requestType: "json",
|
|
258
258
|
body: serializers.agents.MessagesModifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -314,7 +314,7 @@ class Messages {
|
|
|
314
314
|
method: "POST",
|
|
315
315
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
316
316
|
? yield core.Supplier.get(this._options.project)
|
|
317
|
-
: 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.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
318
318
|
contentType: "application/json",
|
|
319
319
|
requestType: "json",
|
|
320
320
|
body: serializers.LettaStreamingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -374,6 +374,81 @@ class Messages {
|
|
|
374
374
|
}
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
|
|
379
|
+
*
|
|
380
|
+
* Note to cancel active runs associated with an agent, redis is required.
|
|
381
|
+
*
|
|
382
|
+
* @param {string} agentId
|
|
383
|
+
* @param {string[]} request
|
|
384
|
+
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
385
|
+
*
|
|
386
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* await client.agents.messages.cancel("agent_id", undefined)
|
|
390
|
+
*/
|
|
391
|
+
cancel(agentId, request, requestOptions) {
|
|
392
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
393
|
+
var _a, _b, _c;
|
|
394
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
395
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/cancel`),
|
|
396
|
+
method: "POST",
|
|
397
|
+
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
398
|
+
? yield core.Supplier.get(this._options.project)
|
|
399
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
400
|
+
contentType: "application/json",
|
|
401
|
+
requestType: "json",
|
|
402
|
+
body: request != null
|
|
403
|
+
? serializers.agents.messages.cancel.Request.jsonOrThrow(request, {
|
|
404
|
+
unrecognizedObjectKeys: "strip",
|
|
405
|
+
})
|
|
406
|
+
: undefined,
|
|
407
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
408
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
409
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
410
|
+
});
|
|
411
|
+
if (_response.ok) {
|
|
412
|
+
return serializers.agents.messages.cancel.Response.parseOrThrow(_response.body, {
|
|
413
|
+
unrecognizedObjectKeys: "passthrough",
|
|
414
|
+
allowUnrecognizedUnionMembers: true,
|
|
415
|
+
allowUnrecognizedEnumValues: true,
|
|
416
|
+
skipValidation: true,
|
|
417
|
+
breadcrumbsPrefix: ["response"],
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
if (_response.error.reason === "status-code") {
|
|
421
|
+
switch (_response.error.statusCode) {
|
|
422
|
+
case 422:
|
|
423
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
424
|
+
unrecognizedObjectKeys: "passthrough",
|
|
425
|
+
allowUnrecognizedUnionMembers: true,
|
|
426
|
+
allowUnrecognizedEnumValues: true,
|
|
427
|
+
skipValidation: true,
|
|
428
|
+
breadcrumbsPrefix: ["response"],
|
|
429
|
+
}));
|
|
430
|
+
default:
|
|
431
|
+
throw new errors.LettaError({
|
|
432
|
+
statusCode: _response.error.statusCode,
|
|
433
|
+
body: _response.error.body,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
switch (_response.error.reason) {
|
|
438
|
+
case "non-json":
|
|
439
|
+
throw new errors.LettaError({
|
|
440
|
+
statusCode: _response.error.statusCode,
|
|
441
|
+
body: _response.error.rawBody,
|
|
442
|
+
});
|
|
443
|
+
case "timeout":
|
|
444
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/cancel.");
|
|
445
|
+
case "unknown":
|
|
446
|
+
throw new errors.LettaError({
|
|
447
|
+
message: _response.error.errorMessage,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
}
|
|
377
452
|
/**
|
|
378
453
|
* Asynchronously process a user message and return a run object.
|
|
379
454
|
* The actual processing happens in the background, and the status can be checked using the run ID.
|
|
@@ -406,7 +481,7 @@ class Messages {
|
|
|
406
481
|
method: "POST",
|
|
407
482
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
408
483
|
? yield core.Supplier.get(this._options.project)
|
|
409
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
484
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
410
485
|
contentType: "application/json",
|
|
411
486
|
requestType: "json",
|
|
412
487
|
body: serializers.agents.LettaAsyncRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -480,7 +555,7 @@ class Messages {
|
|
|
480
555
|
method: "PATCH",
|
|
481
556
|
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
482
557
|
? yield core.Supplier.get(this._options.project)
|
|
483
|
-
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.
|
|
558
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
484
559
|
contentType: "application/json",
|
|
485
560
|
queryParameters: _queryParams,
|
|
486
561
|
requestType: "json",
|
|
@@ -529,6 +604,89 @@ class Messages {
|
|
|
529
604
|
}
|
|
530
605
|
});
|
|
531
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* Inspect the raw LLM request payload without sending it.
|
|
609
|
+
*
|
|
610
|
+
* This endpoint processes the message through the agent loop up until
|
|
611
|
+
* the LLM request, then returns the raw request payload that would
|
|
612
|
+
* be sent to the LLM provider. Useful for debugging and inspection.
|
|
613
|
+
*
|
|
614
|
+
* @param {string} agentId
|
|
615
|
+
* @param {Letta.agents.MessagesPreviewRawPayloadRequest} request
|
|
616
|
+
* @param {Messages.RequestOptions} requestOptions - Request-specific configuration.
|
|
617
|
+
*
|
|
618
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
619
|
+
*
|
|
620
|
+
* @example
|
|
621
|
+
* await client.agents.messages.previewRawPayload("agent_id", {
|
|
622
|
+
* messages: [{
|
|
623
|
+
* role: "user",
|
|
624
|
+
* content: [{
|
|
625
|
+
* type: "text",
|
|
626
|
+
* text: "text"
|
|
627
|
+
* }]
|
|
628
|
+
* }]
|
|
629
|
+
* })
|
|
630
|
+
*/
|
|
631
|
+
previewRawPayload(agentId, request, requestOptions) {
|
|
632
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
633
|
+
var _a, _b, _c;
|
|
634
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
635
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/agents/${encodeURIComponent(agentId)}/messages/preview-raw-payload`),
|
|
636
|
+
method: "POST",
|
|
637
|
+
headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
|
|
638
|
+
? yield core.Supplier.get(this._options.project)
|
|
639
|
+
: undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.151", "User-Agent": "@letta-ai/letta-client/0.1.151", "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),
|
|
640
|
+
contentType: "application/json",
|
|
641
|
+
requestType: "json",
|
|
642
|
+
body: serializers.agents.MessagesPreviewRawPayloadRequest.jsonOrThrow(request, {
|
|
643
|
+
unrecognizedObjectKeys: "strip",
|
|
644
|
+
}),
|
|
645
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
646
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
647
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
648
|
+
});
|
|
649
|
+
if (_response.ok) {
|
|
650
|
+
return serializers.agents.messages.previewRawPayload.Response.parseOrThrow(_response.body, {
|
|
651
|
+
unrecognizedObjectKeys: "passthrough",
|
|
652
|
+
allowUnrecognizedUnionMembers: true,
|
|
653
|
+
allowUnrecognizedEnumValues: true,
|
|
654
|
+
skipValidation: true,
|
|
655
|
+
breadcrumbsPrefix: ["response"],
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
if (_response.error.reason === "status-code") {
|
|
659
|
+
switch (_response.error.statusCode) {
|
|
660
|
+
case 422:
|
|
661
|
+
throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
662
|
+
unrecognizedObjectKeys: "passthrough",
|
|
663
|
+
allowUnrecognizedUnionMembers: true,
|
|
664
|
+
allowUnrecognizedEnumValues: true,
|
|
665
|
+
skipValidation: true,
|
|
666
|
+
breadcrumbsPrefix: ["response"],
|
|
667
|
+
}));
|
|
668
|
+
default:
|
|
669
|
+
throw new errors.LettaError({
|
|
670
|
+
statusCode: _response.error.statusCode,
|
|
671
|
+
body: _response.error.body,
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
switch (_response.error.reason) {
|
|
676
|
+
case "non-json":
|
|
677
|
+
throw new errors.LettaError({
|
|
678
|
+
statusCode: _response.error.statusCode,
|
|
679
|
+
body: _response.error.rawBody,
|
|
680
|
+
});
|
|
681
|
+
case "timeout":
|
|
682
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/preview-raw-payload.");
|
|
683
|
+
case "unknown":
|
|
684
|
+
throw new errors.LettaError({
|
|
685
|
+
message: _response.error.errorMessage,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
}
|
|
532
690
|
_getCustomAuthorizationHeaders() {
|
|
533
691
|
return __awaiter(this, void 0, void 0, function* () {
|
|
534
692
|
const tokenValue = yield core.Supplier.get(this._options.token);
|