@letta-ai/letta-client 0.0.1 → 0.1.0-alpha2
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/Client.d.ts +47 -0
- package/Client.js +47 -0
- package/README.md +153 -1
- package/api/errors/ConflictError.d.ts +8 -0
- package/api/errors/ConflictError.js +41 -0
- package/api/errors/InternalServerError.d.ts +7 -0
- package/api/errors/InternalServerError.js +41 -0
- package/api/errors/NotFoundError.d.ts +7 -0
- package/api/errors/NotFoundError.js +41 -0
- package/api/errors/UnprocessableEntityError.d.ts +8 -0
- package/api/errors/UnprocessableEntityError.js +41 -0
- package/api/errors/index.d.ts +4 -0
- package/api/errors/index.js +20 -0
- package/api/index.d.ts +3 -0
- package/api/index.js +19 -0
- package/api/resources/agents/client/Client.d.ts +209 -0
- package/api/resources/agents/client/Client.js +751 -0
- package/api/resources/agents/client/index.d.ts +1 -0
- package/api/resources/agents/client/index.js +17 -0
- package/api/resources/agents/client/requests/AgentsCreateVersionRequest.d.ts +11 -0
- package/api/resources/agents/client/requests/AgentsCreateVersionRequest.js +5 -0
- package/api/resources/agents/client/requests/AgentsListRequest.d.ts +21 -0
- package/api/resources/agents/client/requests/AgentsListRequest.js +5 -0
- package/api/resources/agents/client/requests/AgentsMigrateRequest.d.ts +16 -0
- package/api/resources/agents/client/requests/AgentsMigrateRequest.js +5 -0
- package/api/resources/agents/client/requests/CreateAgentRequest.d.ts +56 -0
- package/api/resources/agents/client/requests/CreateAgentRequest.js +5 -0
- package/api/resources/agents/client/requests/UpdateAgent.d.ts +34 -0
- package/api/resources/agents/client/requests/UpdateAgent.js +5 -0
- package/api/resources/agents/client/requests/index.d.ts +5 -0
- package/api/resources/agents/client/requests/index.js +2 -0
- package/api/resources/agents/index.d.ts +3 -0
- package/api/resources/agents/index.js +19 -0
- package/api/resources/agents/resources/archivalMemory/client/Client.d.ts +81 -0
- package/api/resources/agents/resources/archivalMemory/client/Client.js +287 -0
- package/api/resources/agents/resources/archivalMemory/client/index.d.ts +1 -0
- package/api/resources/agents/resources/archivalMemory/client/index.js +17 -0
- package/api/resources/agents/resources/archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts +21 -0
- package/api/resources/agents/resources/archivalMemory/client/requests/ArchivalMemoryListRequest.js +5 -0
- package/api/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.d.ts +13 -0
- package/api/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +5 -0
- package/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +2 -0
- package/api/resources/agents/resources/archivalMemory/client/requests/index.js +2 -0
- package/api/resources/agents/resources/archivalMemory/index.d.ts +1 -0
- package/api/resources/agents/resources/archivalMemory/index.js +17 -0
- package/api/resources/agents/resources/context/client/Client.d.ts +40 -0
- package/api/resources/agents/resources/context/client/Client.js +110 -0
- package/api/resources/agents/resources/context/client/index.d.ts +1 -0
- package/api/resources/agents/resources/context/client/index.js +2 -0
- package/api/resources/agents/resources/context/index.d.ts +1 -0
- package/api/resources/agents/resources/context/index.js +17 -0
- package/api/resources/agents/resources/index.d.ts +11 -0
- package/api/resources/agents/resources/index.js +40 -0
- package/api/resources/agents/resources/memory/client/Client.d.ts +44 -0
- package/api/resources/agents/resources/memory/client/Client.js +116 -0
- package/api/resources/agents/resources/memory/client/index.d.ts +1 -0
- package/api/resources/agents/resources/memory/client/index.js +2 -0
- package/api/resources/agents/resources/memory/index.d.ts +2 -0
- package/api/resources/agents/resources/memory/index.js +18 -0
- package/api/resources/agents/resources/memory/resources/index.d.ts +1 -0
- package/api/resources/agents/resources/memory/resources/index.js +27 -0
- package/api/resources/agents/resources/memory/resources/messages/client/Client.d.ts +40 -0
- package/api/resources/agents/resources/memory/resources/messages/client/Client.js +110 -0
- package/api/resources/agents/resources/memory/resources/messages/client/index.d.ts +1 -0
- package/api/resources/agents/resources/memory/resources/messages/client/index.js +2 -0
- package/api/resources/agents/resources/memory/resources/messages/index.d.ts +1 -0
- package/api/resources/agents/resources/memory/resources/messages/index.js +17 -0
- package/api/resources/agents/resources/memoryBlocks/client/Client.d.ts +57 -0
- package/api/resources/agents/resources/memoryBlocks/client/Client.js +169 -0
- package/api/resources/agents/resources/memoryBlocks/client/index.d.ts +1 -0
- package/api/resources/agents/resources/memoryBlocks/client/index.js +2 -0
- package/api/resources/agents/resources/memoryBlocks/index.d.ts +1 -0
- package/api/resources/agents/resources/memoryBlocks/index.js +17 -0
- package/api/resources/agents/resources/messages/client/Client.d.ts +80 -0
- package/api/resources/agents/resources/messages/client/Client.js +303 -0
- package/api/resources/agents/resources/messages/client/index.d.ts +1 -0
- package/api/resources/agents/resources/messages/client/index.js +17 -0
- package/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +14 -0
- package/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +5 -0
- package/api/resources/agents/resources/messages/client/requests/MessageUpdate.d.ts +20 -0
- package/api/resources/agents/resources/messages/client/requests/MessageUpdate.js +5 -0
- package/api/resources/agents/resources/messages/client/requests/MessagesListRequest.d.ts +29 -0
- package/api/resources/agents/resources/messages/client/requests/MessagesListRequest.js +5 -0
- package/api/resources/agents/resources/messages/client/requests/index.d.ts +3 -0
- package/api/resources/agents/resources/messages/client/requests/index.js +2 -0
- package/api/resources/agents/resources/messages/index.d.ts +2 -0
- package/api/resources/agents/resources/messages/index.js +18 -0
- package/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +8 -0
- package/api/resources/agents/resources/messages/types/LettaStreamingResponse.js +5 -0
- package/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +5 -0
- package/api/resources/agents/resources/messages/types/MessagesListResponse.js +5 -0
- package/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +5 -0
- package/api/resources/agents/resources/messages/types/MessagesListResponseItem.js +5 -0
- package/api/resources/agents/resources/messages/types/index.d.ts +3 -0
- package/api/resources/agents/resources/messages/types/index.js +19 -0
- package/api/resources/agents/resources/recallMemory/client/Client.d.ts +40 -0
- package/api/resources/agents/resources/recallMemory/client/Client.js +110 -0
- package/api/resources/agents/resources/recallMemory/client/index.d.ts +1 -0
- package/api/resources/agents/resources/recallMemory/client/index.js +2 -0
- package/api/resources/agents/resources/recallMemory/index.d.ts +1 -0
- package/api/resources/agents/resources/recallMemory/index.js +17 -0
- package/api/resources/agents/resources/sources/client/Client.d.ts +40 -0
- package/api/resources/agents/resources/sources/client/Client.js +110 -0
- package/api/resources/agents/resources/sources/client/index.d.ts +1 -0
- package/api/resources/agents/resources/sources/client/index.js +2 -0
- package/api/resources/agents/resources/sources/index.d.ts +1 -0
- package/api/resources/agents/resources/sources/index.js +17 -0
- package/api/resources/agents/resources/tools/client/Client.d.ts +66 -0
- package/api/resources/agents/resources/tools/client/Client.js +218 -0
- package/api/resources/agents/resources/tools/client/index.d.ts +1 -0
- package/api/resources/agents/resources/tools/client/index.js +2 -0
- package/api/resources/agents/resources/tools/index.d.ts +1 -0
- package/api/resources/agents/resources/tools/index.js +17 -0
- package/api/resources/agents/types/AgentsCreateVersionResponse.d.ts +7 -0
- package/api/resources/agents/types/AgentsCreateVersionResponse.js +5 -0
- package/api/resources/agents/types/AgentsMigrateResponse.d.ts +6 -0
- package/api/resources/agents/types/AgentsMigrateResponse.js +5 -0
- package/api/resources/agents/types/CreateAgentRequestToolRulesItem.d.ts +5 -0
- package/api/resources/agents/types/CreateAgentRequestToolRulesItem.js +5 -0
- package/api/resources/agents/types/UpdateAgentToolRulesItem.d.ts +5 -0
- package/api/resources/agents/types/UpdateAgentToolRulesItem.js +5 -0
- package/api/resources/agents/types/index.d.ts +4 -0
- package/api/resources/agents/types/index.js +20 -0
- package/api/resources/blocks/client/Client.d.ts +112 -0
- package/api/resources/blocks/client/Client.js +450 -0
- package/api/resources/blocks/client/index.d.ts +1 -0
- package/api/resources/blocks/client/index.js +17 -0
- package/api/resources/blocks/client/requests/BlocksListRequest.d.ts +21 -0
- package/api/resources/blocks/client/requests/BlocksListRequest.js +5 -0
- package/api/resources/blocks/client/requests/LinkAgentMemoryBlockRequest.d.ts +15 -0
- package/api/resources/blocks/client/requests/LinkAgentMemoryBlockRequest.js +5 -0
- package/api/resources/blocks/client/requests/UnlinkAgentMemoryBlockRequest.d.ts +15 -0
- package/api/resources/blocks/client/requests/UnlinkAgentMemoryBlockRequest.js +5 -0
- package/api/resources/blocks/client/requests/index.d.ts +3 -0
- package/api/resources/blocks/client/requests/index.js +2 -0
- package/api/resources/blocks/index.d.ts +1 -0
- package/api/resources/blocks/index.js +17 -0
- package/api/resources/health/client/Client.d.ts +35 -0
- package/api/resources/health/client/Client.js +99 -0
- package/api/resources/health/client/index.d.ts +1 -0
- package/api/resources/health/client/index.js +2 -0
- package/api/resources/health/index.d.ts +1 -0
- package/api/resources/health/index.js +17 -0
- package/api/resources/index.d.ts +13 -0
- package/api/resources/index.js +42 -0
- package/api/resources/jobs/client/Client.d.ts +75 -0
- package/api/resources/jobs/client/Client.js +274 -0
- package/api/resources/jobs/client/index.d.ts +1 -0
- package/api/resources/jobs/client/index.js +17 -0
- package/api/resources/jobs/client/requests/JobsListRequest.d.ts +13 -0
- package/api/resources/jobs/client/requests/JobsListRequest.js +5 -0
- package/api/resources/jobs/client/requests/index.d.ts +1 -0
- package/api/resources/jobs/client/requests/index.js +2 -0
- package/api/resources/jobs/index.d.ts +1 -0
- package/api/resources/jobs/index.js +17 -0
- package/api/resources/models/client/Client.d.ts +42 -0
- package/api/resources/models/client/Client.js +142 -0
- package/api/resources/models/client/index.d.ts +1 -0
- package/api/resources/models/client/index.js +2 -0
- package/api/resources/models/index.d.ts +1 -0
- package/api/resources/models/index.js +17 -0
- package/api/resources/sources/client/Client.d.ts +138 -0
- package/api/resources/sources/client/Client.js +509 -0
- package/api/resources/sources/client/index.d.ts +1 -0
- package/api/resources/sources/client/index.js +17 -0
- package/api/resources/sources/client/requests/SourceCreate.d.ts +20 -0
- package/api/resources/sources/client/requests/SourceCreate.js +5 -0
- package/api/resources/sources/client/requests/SourceUpdate.d.ts +18 -0
- package/api/resources/sources/client/requests/SourceUpdate.js +5 -0
- package/api/resources/sources/client/requests/SourcesAttachRequest.d.ts +15 -0
- package/api/resources/sources/client/requests/SourcesAttachRequest.js +5 -0
- package/api/resources/sources/client/requests/SourcesDetachRequest.d.ts +15 -0
- package/api/resources/sources/client/requests/SourcesDetachRequest.js +5 -0
- package/api/resources/sources/client/requests/index.d.ts +4 -0
- package/api/resources/sources/client/requests/index.js +2 -0
- package/api/resources/sources/index.d.ts +2 -0
- package/api/resources/sources/index.js +18 -0
- package/api/resources/sources/resources/files/client/Client.d.ts +70 -0
- package/api/resources/sources/resources/files/client/Client.js +232 -0
- package/api/resources/sources/resources/files/client/index.d.ts +1 -0
- package/api/resources/sources/resources/files/client/index.js +17 -0
- package/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +9 -0
- package/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.js +5 -0
- package/api/resources/sources/resources/files/client/requests/FilesListRequest.d.ts +17 -0
- package/api/resources/sources/resources/files/client/requests/FilesListRequest.js +5 -0
- package/api/resources/sources/resources/files/client/requests/index.d.ts +2 -0
- package/api/resources/sources/resources/files/client/requests/index.js +2 -0
- package/api/resources/sources/resources/files/index.d.ts +1 -0
- package/api/resources/sources/resources/files/index.js +17 -0
- package/api/resources/sources/resources/index.d.ts +3 -0
- package/api/resources/sources/resources/index.js +32 -0
- package/api/resources/sources/resources/passages/client/Client.d.ts +40 -0
- package/api/resources/sources/resources/passages/client/Client.js +110 -0
- package/api/resources/sources/resources/passages/client/index.d.ts +1 -0
- package/api/resources/sources/resources/passages/client/index.js +2 -0
- package/api/resources/sources/resources/passages/index.d.ts +1 -0
- package/api/resources/sources/resources/passages/index.js +17 -0
- package/api/resources/tools/client/Client.d.ts +178 -0
- package/api/resources/tools/client/Client.js +712 -0
- package/api/resources/tools/client/index.d.ts +1 -0
- package/api/resources/tools/client/index.js +17 -0
- package/api/resources/tools/client/requests/ToolRunFromSource.d.ts +20 -0
- package/api/resources/tools/client/requests/ToolRunFromSource.js +5 -0
- package/api/resources/tools/client/requests/ToolUpdate.d.ts +23 -0
- package/api/resources/tools/client/requests/ToolUpdate.js +5 -0
- package/api/resources/tools/client/requests/ToolsListRequest.d.ts +11 -0
- package/api/resources/tools/client/requests/ToolsListRequest.js +5 -0
- package/api/resources/tools/client/requests/index.d.ts +3 -0
- package/api/resources/tools/client/requests/index.js +2 -0
- package/api/resources/tools/index.d.ts +1 -0
- package/api/resources/tools/index.js +17 -0
- package/api/types/ActionModel.d.ts +19 -0
- package/api/types/ActionModel.js +5 -0
- package/api/types/ActionParametersModel.d.ts +12 -0
- package/api/types/ActionParametersModel.js +5 -0
- package/api/types/ActionResponseModel.d.ts +12 -0
- package/api/types/ActionResponseModel.js +5 -0
- package/api/types/AgentState.d.ts +58 -0
- package/api/types/AgentState.js +5 -0
- package/api/types/AgentStateToolRulesItem.d.ts +5 -0
- package/api/types/AgentStateToolRulesItem.js +5 -0
- package/api/types/AgentType.d.ts +14 -0
- package/api/types/AgentType.js +13 -0
- package/api/types/AppAuthScheme.d.ts +19 -0
- package/api/types/AppAuthScheme.js +5 -0
- package/api/types/AppAuthSchemeAuthMode.d.ts +12 -0
- package/api/types/AppAuthSchemeAuthMode.js +14 -0
- package/api/types/AppModel.d.ts +25 -0
- package/api/types/AppModel.js +5 -0
- package/api/types/ArchivalMemorySummary.d.ts +7 -0
- package/api/types/ArchivalMemorySummary.js +5 -0
- package/api/types/AssistantFile.d.ts +12 -0
- package/api/types/AssistantFile.js +5 -0
- package/api/types/AssistantMessageInput.d.ts +10 -0
- package/api/types/AssistantMessageInput.js +5 -0
- package/api/types/AssistantMessageOutput.d.ts +9 -0
- package/api/types/AssistantMessageOutput.js +5 -0
- package/api/types/AuthRequest.d.ts +7 -0
- package/api/types/AuthRequest.js +5 -0
- package/api/types/AuthResponse.d.ts +9 -0
- package/api/types/AuthResponse.js +5 -0
- package/api/types/AuthSchemeField.d.ts +16 -0
- package/api/types/AuthSchemeField.js +5 -0
- package/api/types/Block.d.ts +41 -0
- package/api/types/Block.js +5 -0
- package/api/types/BlockUpdate.d.ts +22 -0
- package/api/types/BlockUpdate.js +5 -0
- package/api/types/ChatCompletionRequest.d.ts +29 -0
- package/api/types/ChatCompletionRequest.js +5 -0
- package/api/types/ChatCompletionRequestFunctionCall.d.ts +5 -0
- package/api/types/ChatCompletionRequestFunctionCall.js +5 -0
- package/api/types/ChatCompletionRequestMessagesItem.d.ts +5 -0
- package/api/types/ChatCompletionRequestMessagesItem.js +5 -0
- package/api/types/ChatCompletionRequestStop.d.ts +4 -0
- package/api/types/ChatCompletionRequestStop.js +5 -0
- package/api/types/ChatCompletionRequestToolChoice.d.ts +5 -0
- package/api/types/ChatCompletionRequestToolChoice.js +5 -0
- package/api/types/ChatCompletionResponse.d.ts +16 -0
- package/api/types/ChatCompletionResponse.js +5 -0
- package/api/types/ChildToolRule.d.ts +14 -0
- package/api/types/ChildToolRule.js +5 -0
- package/api/types/Choice.d.ts +11 -0
- package/api/types/Choice.js +5 -0
- package/api/types/ConditionalToolRule.d.ts +18 -0
- package/api/types/ConditionalToolRule.js +5 -0
- package/api/types/ConflictErrorBody.d.ts +6 -0
- package/api/types/ConflictErrorBody.js +5 -0
- package/api/types/ContextWindowOverview.d.ts +41 -0
- package/api/types/ContextWindowOverview.js +5 -0
- package/api/types/CreateAssistantFileRequest.d.ts +7 -0
- package/api/types/CreateAssistantFileRequest.js +5 -0
- package/api/types/CreateAssistantRequest.d.ts +21 -0
- package/api/types/CreateAssistantRequest.js +5 -0
- package/api/types/CreateBlock.d.ts +21 -0
- package/api/types/CreateBlock.js +5 -0
- package/api/types/DeleteAssistantFileResponse.d.ts +10 -0
- package/api/types/DeleteAssistantFileResponse.js +5 -0
- package/api/types/DeleteAssistantResponse.d.ts +10 -0
- package/api/types/DeleteAssistantResponse.js +5 -0
- package/api/types/E2BSandboxConfig.d.ts +11 -0
- package/api/types/E2BSandboxConfig.js +5 -0
- package/api/types/EmbeddingConfig.d.ts +37 -0
- package/api/types/EmbeddingConfig.js +5 -0
- package/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +26 -0
- package/api/types/EmbeddingConfigEmbeddingEndpointType.js +25 -0
- package/api/types/FileMetadata.d.ts +32 -0
- package/api/types/FileMetadata.js +5 -0
- package/api/types/FunctionCallInput.d.ts +6 -0
- package/api/types/FunctionCallInput.js +5 -0
- package/api/types/FunctionCallOutput.d.ts +7 -0
- package/api/types/FunctionCallOutput.js +5 -0
- package/api/types/FunctionSchema.d.ts +8 -0
- package/api/types/FunctionSchema.js +5 -0
- package/api/types/Health.d.ts +10 -0
- package/api/types/Health.js +5 -0
- package/api/types/HttpValidationError.d.ts +7 -0
- package/api/types/HttpValidationError.js +5 -0
- package/api/types/InitToolRule.d.ts +12 -0
- package/api/types/InitToolRule.js +5 -0
- package/api/types/InternalServerErrorBody.d.ts +6 -0
- package/api/types/InternalServerErrorBody.js +5 -0
- package/api/types/Job.d.ts +34 -0
- package/api/types/Job.js +5 -0
- package/api/types/JobStatus.d.ts +14 -0
- package/api/types/JobStatus.js +13 -0
- package/api/types/LettaRequest.d.ts +12 -0
- package/api/types/LettaRequest.js +5 -0
- package/api/types/LettaResponse.d.ts +68 -0
- package/api/types/LettaResponse.js +5 -0
- package/api/types/LettaResponseAssistantMessage.d.ts +9 -0
- package/api/types/LettaResponseAssistantMessage.js +5 -0
- package/api/types/LettaResponseLettaUsageStatistics.d.ts +22 -0
- package/api/types/LettaResponseLettaUsageStatistics.js +5 -0
- package/api/types/LettaResponseReasoningMessage.d.ts +17 -0
- package/api/types/LettaResponseReasoningMessage.js +5 -0
- package/api/types/LettaResponseSystemMessage.d.ts +17 -0
- package/api/types/LettaResponseSystemMessage.js +5 -0
- package/api/types/LettaResponseToolCall.d.ts +8 -0
- package/api/types/LettaResponseToolCall.js +5 -0
- package/api/types/LettaResponseToolCallDelta.d.ts +8 -0
- package/api/types/LettaResponseToolCallDelta.js +5 -0
- package/api/types/LettaResponseToolCallMessage.d.ts +18 -0
- package/api/types/LettaResponseToolCallMessage.js +5 -0
- package/api/types/LettaResponseToolCallMessageToolCall.d.ts +5 -0
- package/api/types/LettaResponseToolCallMessageToolCall.js +5 -0
- package/api/types/LettaResponseToolCallMessageToolCallOne.d.ts +8 -0
- package/api/types/LettaResponseToolCallMessageToolCallOne.js +5 -0
- package/api/types/LettaResponseToolCallMessageToolCallZero.d.ts +8 -0
- package/api/types/LettaResponseToolCallMessageToolCallZero.js +5 -0
- package/api/types/LettaResponseToolReturnMessage.d.ts +26 -0
- package/api/types/LettaResponseToolReturnMessage.js +5 -0
- package/api/types/LettaResponseToolReturnMessageStatus.d.ts +8 -0
- package/api/types/LettaResponseToolReturnMessageStatus.js +10 -0
- package/api/types/LettaResponseUserMessage.d.ts +17 -0
- package/api/types/LettaResponseUserMessage.js +5 -0
- package/api/types/LettaSchemasLettaMessageToolCall.d.ts +8 -0
- package/api/types/LettaSchemasLettaMessageToolCall.js +5 -0
- package/api/types/LettaSchemasMessageMessage.d.ts +47 -0
- package/api/types/LettaSchemasMessageMessage.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionRequestTool.d.ts +8 -0
- package/api/types/LettaSchemasOpenaiChatCompletionRequestTool.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionRequestToolCall.d.ts +9 -0
- package/api/types/LettaSchemasOpenaiChatCompletionRequestToolCall.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.d.ts +7 -0
- package/api/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionResponseMessage.d.ts +10 -0
- package/api/types/LettaSchemasOpenaiChatCompletionResponseMessage.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionResponseToolCall.d.ts +9 -0
- package/api/types/LettaSchemasOpenaiChatCompletionResponseToolCall.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.d.ts +9 -0
- package/api/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionsToolCallInput.d.ts +11 -0
- package/api/types/LettaSchemasOpenaiChatCompletionsToolCallInput.js +5 -0
- package/api/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.d.ts +11 -0
- package/api/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.js +5 -0
- package/api/types/LettaSchemasToolTool.d.ts +39 -0
- package/api/types/LettaSchemasToolTool.js +5 -0
- package/api/types/LettaUsageStatistics.d.ts +22 -0
- package/api/types/LettaUsageStatistics.js +5 -0
- package/api/types/LlmConfig.d.ts +31 -0
- package/api/types/LlmConfig.js +5 -0
- package/api/types/LlmConfigModelEndpointType.d.ts +26 -0
- package/api/types/LlmConfigModelEndpointType.js +25 -0
- package/api/types/LocalSandboxConfig.d.ts +11 -0
- package/api/types/LocalSandboxConfig.js +5 -0
- package/api/types/LogProbToken.d.ts +8 -0
- package/api/types/LogProbToken.js +5 -0
- package/api/types/Memory.d.ts +13 -0
- package/api/types/Memory.js +5 -0
- package/api/types/MessageContentLogProb.d.ts +10 -0
- package/api/types/MessageContentLogProb.js +5 -0
- package/api/types/MessageCreate.d.ts +15 -0
- package/api/types/MessageCreate.js +5 -0
- package/api/types/MessageCreateRole.d.ts +11 -0
- package/api/types/MessageCreateRole.js +10 -0
- package/api/types/MessageRole.d.ts +11 -0
- package/api/types/MessageRole.js +13 -0
- package/api/types/NotFoundErrorBody.d.ts +7 -0
- package/api/types/NotFoundErrorBody.js +5 -0
- package/api/types/NotFoundErrorBodyMessage.d.ts +8 -0
- package/api/types/NotFoundErrorBodyMessage.js +10 -0
- package/api/types/OpenAiAssistant.d.ts +27 -0
- package/api/types/OpenAiAssistant.js +5 -0
- package/api/types/Organization.d.ts +11 -0
- package/api/types/Organization.js +5 -0
- package/api/types/OrganizationCreate.d.ts +7 -0
- package/api/types/OrganizationCreate.js +5 -0
- package/api/types/Passage.d.ts +47 -0
- package/api/types/Passage.js +5 -0
- package/api/types/ReasoningMessage.d.ts +17 -0
- package/api/types/ReasoningMessage.js +5 -0
- package/api/types/RecallMemorySummary.d.ts +7 -0
- package/api/types/RecallMemorySummary.js +5 -0
- package/api/types/ResponseFormat.d.ts +6 -0
- package/api/types/ResponseFormat.js +5 -0
- package/api/types/SandboxConfig.d.ts +22 -0
- package/api/types/SandboxConfig.js +5 -0
- package/api/types/SandboxConfigCreate.d.ts +8 -0
- package/api/types/SandboxConfigCreate.js +5 -0
- package/api/types/SandboxConfigCreateConfig.d.ts +8 -0
- package/api/types/SandboxConfigCreateConfig.js +5 -0
- package/api/types/SandboxConfigUpdate.d.ts +11 -0
- package/api/types/SandboxConfigUpdate.js +5 -0
- package/api/types/SandboxConfigUpdateConfig.d.ts +8 -0
- package/api/types/SandboxConfigUpdateConfig.js +5 -0
- package/api/types/SandboxEnvironmentVariable.d.ts +25 -0
- package/api/types/SandboxEnvironmentVariable.js +5 -0
- package/api/types/SandboxEnvironmentVariableCreate.d.ts +11 -0
- package/api/types/SandboxEnvironmentVariableCreate.js +5 -0
- package/api/types/SandboxEnvironmentVariableUpdate.d.ts +14 -0
- package/api/types/SandboxEnvironmentVariableUpdate.js +5 -0
- package/api/types/SandboxType.d.ts +8 -0
- package/api/types/SandboxType.js +10 -0
- package/api/types/Source.d.ts +37 -0
- package/api/types/Source.js +5 -0
- package/api/types/SystemMessageInput.d.ts +8 -0
- package/api/types/SystemMessageInput.js +5 -0
- package/api/types/SystemMessageOutput.d.ts +17 -0
- package/api/types/SystemMessageOutput.js +5 -0
- package/api/types/TerminalToolRule.d.ts +12 -0
- package/api/types/TerminalToolRule.js +5 -0
- package/api/types/ToolCallDelta.d.ts +8 -0
- package/api/types/ToolCallDelta.js +5 -0
- package/api/types/ToolCallFunctionOutput.d.ts +9 -0
- package/api/types/ToolCallFunctionOutput.js +5 -0
- package/api/types/ToolCallMessage.d.ts +18 -0
- package/api/types/ToolCallMessage.js +5 -0
- package/api/types/ToolCallMessageToolCall.d.ts +5 -0
- package/api/types/ToolCallMessageToolCall.js +5 -0
- package/api/types/ToolCreate.d.ts +21 -0
- package/api/types/ToolCreate.js +5 -0
- package/api/types/ToolFunctionChoice.d.ts +8 -0
- package/api/types/ToolFunctionChoice.js +5 -0
- package/api/types/ToolInput.d.ts +8 -0
- package/api/types/ToolInput.js +5 -0
- package/api/types/ToolMessage.d.ts +8 -0
- package/api/types/ToolMessage.js +5 -0
- package/api/types/ToolReturnMessage.d.ts +26 -0
- package/api/types/ToolReturnMessage.js +5 -0
- package/api/types/ToolReturnMessageStatus.d.ts +8 -0
- package/api/types/ToolReturnMessageStatus.js +10 -0
- package/api/types/ToolRuleType.d.ts +15 -0
- package/api/types/ToolRuleType.js +14 -0
- package/api/types/UsageStatistics.d.ts +8 -0
- package/api/types/UsageStatistics.js +5 -0
- package/api/types/User.d.ts +25 -0
- package/api/types/User.js +5 -0
- package/api/types/UserCreate.d.ts +9 -0
- package/api/types/UserCreate.js +5 -0
- package/api/types/UserMessageInput.d.ts +9 -0
- package/api/types/UserMessageInput.js +5 -0
- package/api/types/UserMessageInputContent.d.ts +4 -0
- package/api/types/UserMessageInputContent.js +5 -0
- package/api/types/UserMessageOutput.d.ts +17 -0
- package/api/types/UserMessageOutput.js +5 -0
- package/api/types/UserUpdate.d.ts +11 -0
- package/api/types/UserUpdate.js +5 -0
- package/api/types/ValidationError.d.ts +9 -0
- package/api/types/ValidationError.js +5 -0
- package/api/types/ValidationErrorLocItem.d.ts +4 -0
- package/api/types/ValidationErrorLocItem.js +5 -0
- package/api/types/index.d.ts +125 -0
- package/api/types/index.js +141 -0
- package/core/auth/BasicAuth.d.ts +8 -0
- package/core/auth/BasicAuth.js +26 -0
- package/core/auth/BearerToken.d.ts +5 -0
- package/core/auth/BearerToken.js +15 -0
- package/core/auth/index.d.ts +2 -0
- package/core/auth/index.js +7 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/core/fetcher/Fetcher.d.ts +39 -0
- package/core/fetcher/Fetcher.js +99 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +22 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +12 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +55 -0
- package/core/fetcher/index.d.ts +5 -0
- package/core/fetcher/index.js +9 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +41 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
- package/core/form-data-utils/FormDataWrapper.d.ts +60 -0
- package/core/form-data-utils/FormDataWrapper.js +174 -0
- package/core/form-data-utils/index.d.ts +1 -0
- package/core/form-data-utils/index.js +17 -0
- package/core/index.d.ts +5 -0
- package/core/index.js +21 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +9 -0
- package/core/runtime/runtime.js +93 -0
- package/core/streaming-fetcher/Stream.d.ts +48 -0
- package/core/streaming-fetcher/Stream.js +170 -0
- package/core/streaming-fetcher/index.d.ts +1 -0
- package/core/streaming-fetcher/index.js +5 -0
- package/dist/Client.d.ts +47 -0
- package/dist/Client.js +47 -0
- package/dist/api/errors/ConflictError.d.ts +8 -0
- package/dist/api/errors/ConflictError.js +41 -0
- package/dist/api/errors/InternalServerError.d.ts +7 -0
- package/dist/api/errors/InternalServerError.js +41 -0
- package/dist/api/errors/NotFoundError.d.ts +7 -0
- package/dist/api/errors/NotFoundError.js +41 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +8 -0
- package/dist/api/errors/UnprocessableEntityError.js +41 -0
- package/dist/api/errors/index.d.ts +4 -0
- package/dist/api/errors/index.js +20 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/agents/client/Client.d.ts +209 -0
- package/dist/api/resources/agents/client/Client.js +751 -0
- package/dist/api/resources/agents/client/index.d.ts +1 -0
- package/dist/api/resources/agents/client/index.js +17 -0
- package/dist/api/resources/agents/client/requests/AgentsCreateVersionRequest.d.ts +11 -0
- package/dist/api/resources/agents/client/requests/AgentsCreateVersionRequest.js +5 -0
- package/dist/api/resources/agents/client/requests/AgentsListRequest.d.ts +21 -0
- package/dist/api/resources/agents/client/requests/AgentsListRequest.js +5 -0
- package/dist/api/resources/agents/client/requests/AgentsMigrateRequest.d.ts +16 -0
- package/dist/api/resources/agents/client/requests/AgentsMigrateRequest.js +5 -0
- package/dist/api/resources/agents/client/requests/CreateAgentRequest.d.ts +56 -0
- package/dist/api/resources/agents/client/requests/CreateAgentRequest.js +5 -0
- package/dist/api/resources/agents/client/requests/UpdateAgent.d.ts +34 -0
- package/dist/api/resources/agents/client/requests/UpdateAgent.js +5 -0
- package/dist/api/resources/agents/client/requests/index.d.ts +5 -0
- package/dist/api/resources/agents/client/requests/index.js +2 -0
- package/dist/api/resources/agents/index.d.ts +3 -0
- package/dist/api/resources/agents/index.js +19 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/Client.d.ts +81 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/Client.js +287 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/index.js +17 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/ArchivalMemoryListRequest.d.ts +21 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/ArchivalMemoryListRequest.js +5 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.d.ts +13 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/CreateArchivalMemory.js +5 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.d.ts +2 -0
- package/dist/api/resources/agents/resources/archivalMemory/client/requests/index.js +2 -0
- package/dist/api/resources/agents/resources/archivalMemory/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/archivalMemory/index.js +17 -0
- package/dist/api/resources/agents/resources/context/client/Client.d.ts +40 -0
- package/dist/api/resources/agents/resources/context/client/Client.js +110 -0
- package/dist/api/resources/agents/resources/context/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/context/client/index.js +2 -0
- package/dist/api/resources/agents/resources/context/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/context/index.js +17 -0
- package/dist/api/resources/agents/resources/index.d.ts +11 -0
- package/dist/api/resources/agents/resources/index.js +40 -0
- package/dist/api/resources/agents/resources/memory/client/Client.d.ts +44 -0
- package/dist/api/resources/agents/resources/memory/client/Client.js +116 -0
- package/dist/api/resources/agents/resources/memory/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/memory/client/index.js +2 -0
- package/dist/api/resources/agents/resources/memory/index.d.ts +2 -0
- package/dist/api/resources/agents/resources/memory/index.js +18 -0
- package/dist/api/resources/agents/resources/memory/resources/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/memory/resources/index.js +27 -0
- package/dist/api/resources/agents/resources/memory/resources/messages/client/Client.d.ts +40 -0
- package/dist/api/resources/agents/resources/memory/resources/messages/client/Client.js +110 -0
- package/dist/api/resources/agents/resources/memory/resources/messages/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/memory/resources/messages/client/index.js +2 -0
- package/dist/api/resources/agents/resources/memory/resources/messages/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/memory/resources/messages/index.js +17 -0
- package/dist/api/resources/agents/resources/memoryBlocks/client/Client.d.ts +57 -0
- package/dist/api/resources/agents/resources/memoryBlocks/client/Client.js +169 -0
- package/dist/api/resources/agents/resources/memoryBlocks/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/memoryBlocks/client/index.js +2 -0
- package/dist/api/resources/agents/resources/memoryBlocks/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/memoryBlocks/index.js +17 -0
- package/dist/api/resources/agents/resources/messages/client/Client.d.ts +80 -0
- package/dist/api/resources/agents/resources/messages/client/Client.js +303 -0
- package/dist/api/resources/agents/resources/messages/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/messages/client/index.js +17 -0
- package/dist/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.d.ts +14 -0
- package/dist/api/resources/agents/resources/messages/client/requests/LettaStreamingRequest.js +5 -0
- package/dist/api/resources/agents/resources/messages/client/requests/MessageUpdate.d.ts +20 -0
- package/dist/api/resources/agents/resources/messages/client/requests/MessageUpdate.js +5 -0
- package/dist/api/resources/agents/resources/messages/client/requests/MessagesListRequest.d.ts +29 -0
- package/dist/api/resources/agents/resources/messages/client/requests/MessagesListRequest.js +5 -0
- package/dist/api/resources/agents/resources/messages/client/requests/index.d.ts +3 -0
- package/dist/api/resources/agents/resources/messages/client/requests/index.js +2 -0
- package/dist/api/resources/agents/resources/messages/index.d.ts +2 -0
- package/dist/api/resources/agents/resources/messages/index.js +18 -0
- package/dist/api/resources/agents/resources/messages/types/LettaStreamingResponse.d.ts +8 -0
- package/dist/api/resources/agents/resources/messages/types/LettaStreamingResponse.js +5 -0
- package/dist/api/resources/agents/resources/messages/types/MessagesListResponse.d.ts +5 -0
- package/dist/api/resources/agents/resources/messages/types/MessagesListResponse.js +5 -0
- package/dist/api/resources/agents/resources/messages/types/MessagesListResponseItem.d.ts +5 -0
- package/dist/api/resources/agents/resources/messages/types/MessagesListResponseItem.js +5 -0
- package/dist/api/resources/agents/resources/messages/types/index.d.ts +3 -0
- package/dist/api/resources/agents/resources/messages/types/index.js +19 -0
- package/dist/api/resources/agents/resources/recallMemory/client/Client.d.ts +40 -0
- package/dist/api/resources/agents/resources/recallMemory/client/Client.js +110 -0
- package/dist/api/resources/agents/resources/recallMemory/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/recallMemory/client/index.js +2 -0
- package/dist/api/resources/agents/resources/recallMemory/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/recallMemory/index.js +17 -0
- package/dist/api/resources/agents/resources/sources/client/Client.d.ts +40 -0
- package/dist/api/resources/agents/resources/sources/client/Client.js +110 -0
- package/dist/api/resources/agents/resources/sources/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/sources/client/index.js +2 -0
- package/dist/api/resources/agents/resources/sources/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/sources/index.js +17 -0
- package/dist/api/resources/agents/resources/tools/client/Client.d.ts +66 -0
- package/dist/api/resources/agents/resources/tools/client/Client.js +218 -0
- package/dist/api/resources/agents/resources/tools/client/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/tools/client/index.js +2 -0
- package/dist/api/resources/agents/resources/tools/index.d.ts +1 -0
- package/dist/api/resources/agents/resources/tools/index.js +17 -0
- package/dist/api/resources/agents/types/AgentsCreateVersionResponse.d.ts +7 -0
- package/dist/api/resources/agents/types/AgentsCreateVersionResponse.js +5 -0
- package/dist/api/resources/agents/types/AgentsMigrateResponse.d.ts +6 -0
- package/dist/api/resources/agents/types/AgentsMigrateResponse.js +5 -0
- package/dist/api/resources/agents/types/CreateAgentRequestToolRulesItem.d.ts +5 -0
- package/dist/api/resources/agents/types/CreateAgentRequestToolRulesItem.js +5 -0
- package/dist/api/resources/agents/types/UpdateAgentToolRulesItem.d.ts +5 -0
- package/dist/api/resources/agents/types/UpdateAgentToolRulesItem.js +5 -0
- package/dist/api/resources/agents/types/index.d.ts +4 -0
- package/dist/api/resources/agents/types/index.js +20 -0
- package/dist/api/resources/blocks/client/Client.d.ts +112 -0
- package/dist/api/resources/blocks/client/Client.js +450 -0
- package/dist/api/resources/blocks/client/index.d.ts +1 -0
- package/dist/api/resources/blocks/client/index.js +17 -0
- package/dist/api/resources/blocks/client/requests/BlocksListRequest.d.ts +21 -0
- package/dist/api/resources/blocks/client/requests/BlocksListRequest.js +5 -0
- package/dist/api/resources/blocks/client/requests/LinkAgentMemoryBlockRequest.d.ts +15 -0
- package/dist/api/resources/blocks/client/requests/LinkAgentMemoryBlockRequest.js +5 -0
- package/dist/api/resources/blocks/client/requests/UnlinkAgentMemoryBlockRequest.d.ts +15 -0
- package/dist/api/resources/blocks/client/requests/UnlinkAgentMemoryBlockRequest.js +5 -0
- package/dist/api/resources/blocks/client/requests/index.d.ts +3 -0
- package/dist/api/resources/blocks/client/requests/index.js +2 -0
- package/dist/api/resources/blocks/index.d.ts +1 -0
- package/dist/api/resources/blocks/index.js +17 -0
- package/dist/api/resources/health/client/Client.d.ts +35 -0
- package/dist/api/resources/health/client/Client.js +99 -0
- package/dist/api/resources/health/client/index.d.ts +1 -0
- package/dist/api/resources/health/client/index.js +2 -0
- package/dist/api/resources/health/index.d.ts +1 -0
- package/dist/api/resources/health/index.js +17 -0
- package/dist/api/resources/index.d.ts +13 -0
- package/dist/api/resources/index.js +42 -0
- package/dist/api/resources/jobs/client/Client.d.ts +75 -0
- package/dist/api/resources/jobs/client/Client.js +274 -0
- package/dist/api/resources/jobs/client/index.d.ts +1 -0
- package/dist/api/resources/jobs/client/index.js +17 -0
- package/dist/api/resources/jobs/client/requests/JobsListRequest.d.ts +13 -0
- package/dist/api/resources/jobs/client/requests/JobsListRequest.js +5 -0
- package/dist/api/resources/jobs/client/requests/index.d.ts +1 -0
- package/dist/api/resources/jobs/client/requests/index.js +2 -0
- package/dist/api/resources/jobs/index.d.ts +1 -0
- package/dist/api/resources/jobs/index.js +17 -0
- package/dist/api/resources/models/client/Client.d.ts +42 -0
- package/dist/api/resources/models/client/Client.js +142 -0
- package/dist/api/resources/models/client/index.d.ts +1 -0
- package/dist/api/resources/models/client/index.js +2 -0
- package/dist/api/resources/models/index.d.ts +1 -0
- package/dist/api/resources/models/index.js +17 -0
- package/dist/api/resources/sources/client/Client.d.ts +138 -0
- package/dist/api/resources/sources/client/Client.js +509 -0
- package/dist/api/resources/sources/client/index.d.ts +1 -0
- package/dist/api/resources/sources/client/index.js +17 -0
- package/dist/api/resources/sources/client/requests/SourceCreate.d.ts +20 -0
- package/dist/api/resources/sources/client/requests/SourceCreate.js +5 -0
- package/dist/api/resources/sources/client/requests/SourceUpdate.d.ts +18 -0
- package/dist/api/resources/sources/client/requests/SourceUpdate.js +5 -0
- package/dist/api/resources/sources/client/requests/SourcesAttachRequest.d.ts +15 -0
- package/dist/api/resources/sources/client/requests/SourcesAttachRequest.js +5 -0
- package/dist/api/resources/sources/client/requests/SourcesDetachRequest.d.ts +15 -0
- package/dist/api/resources/sources/client/requests/SourcesDetachRequest.js +5 -0
- package/dist/api/resources/sources/client/requests/index.d.ts +4 -0
- package/dist/api/resources/sources/client/requests/index.js +2 -0
- package/dist/api/resources/sources/index.d.ts +2 -0
- package/dist/api/resources/sources/index.js +18 -0
- package/dist/api/resources/sources/resources/files/client/Client.d.ts +70 -0
- package/dist/api/resources/sources/resources/files/client/Client.js +232 -0
- package/dist/api/resources/sources/resources/files/client/index.d.ts +1 -0
- package/dist/api/resources/sources/resources/files/client/index.js +17 -0
- package/dist/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.d.ts +9 -0
- package/dist/api/resources/sources/resources/files/client/requests/BodyUploadFileToSource.js +5 -0
- package/dist/api/resources/sources/resources/files/client/requests/FilesListRequest.d.ts +17 -0
- package/dist/api/resources/sources/resources/files/client/requests/FilesListRequest.js +5 -0
- package/dist/api/resources/sources/resources/files/client/requests/index.d.ts +2 -0
- package/dist/api/resources/sources/resources/files/client/requests/index.js +2 -0
- package/dist/api/resources/sources/resources/files/index.d.ts +1 -0
- package/dist/api/resources/sources/resources/files/index.js +17 -0
- package/dist/api/resources/sources/resources/index.d.ts +3 -0
- package/dist/api/resources/sources/resources/index.js +32 -0
- package/dist/api/resources/sources/resources/passages/client/Client.d.ts +40 -0
- package/dist/api/resources/sources/resources/passages/client/Client.js +110 -0
- package/dist/api/resources/sources/resources/passages/client/index.d.ts +1 -0
- package/dist/api/resources/sources/resources/passages/client/index.js +2 -0
- package/dist/api/resources/sources/resources/passages/index.d.ts +1 -0
- package/dist/api/resources/sources/resources/passages/index.js +17 -0
- package/dist/api/resources/tools/client/Client.d.ts +178 -0
- package/dist/api/resources/tools/client/Client.js +712 -0
- package/dist/api/resources/tools/client/index.d.ts +1 -0
- package/dist/api/resources/tools/client/index.js +17 -0
- package/dist/api/resources/tools/client/requests/ToolRunFromSource.d.ts +20 -0
- package/dist/api/resources/tools/client/requests/ToolRunFromSource.js +5 -0
- package/dist/api/resources/tools/client/requests/ToolUpdate.d.ts +23 -0
- package/dist/api/resources/tools/client/requests/ToolUpdate.js +5 -0
- package/dist/api/resources/tools/client/requests/ToolsListRequest.d.ts +11 -0
- package/dist/api/resources/tools/client/requests/ToolsListRequest.js +5 -0
- package/dist/api/resources/tools/client/requests/index.d.ts +3 -0
- package/dist/api/resources/tools/client/requests/index.js +2 -0
- package/dist/api/resources/tools/index.d.ts +1 -0
- package/dist/api/resources/tools/index.js +17 -0
- package/dist/api/types/ActionModel.d.ts +19 -0
- package/dist/api/types/ActionModel.js +5 -0
- package/dist/api/types/ActionParametersModel.d.ts +12 -0
- package/dist/api/types/ActionParametersModel.js +5 -0
- package/dist/api/types/ActionResponseModel.d.ts +12 -0
- package/dist/api/types/ActionResponseModel.js +5 -0
- package/dist/api/types/AgentState.d.ts +58 -0
- package/dist/api/types/AgentState.js +5 -0
- package/dist/api/types/AgentStateToolRulesItem.d.ts +5 -0
- package/dist/api/types/AgentStateToolRulesItem.js +5 -0
- package/dist/api/types/AgentType.d.ts +14 -0
- package/dist/api/types/AgentType.js +13 -0
- package/dist/api/types/AppAuthScheme.d.ts +19 -0
- package/dist/api/types/AppAuthScheme.js +5 -0
- package/dist/api/types/AppAuthSchemeAuthMode.d.ts +12 -0
- package/dist/api/types/AppAuthSchemeAuthMode.js +14 -0
- package/dist/api/types/AppModel.d.ts +25 -0
- package/dist/api/types/AppModel.js +5 -0
- package/dist/api/types/ArchivalMemorySummary.d.ts +7 -0
- package/dist/api/types/ArchivalMemorySummary.js +5 -0
- package/dist/api/types/AssistantFile.d.ts +12 -0
- package/dist/api/types/AssistantFile.js +5 -0
- package/dist/api/types/AssistantMessageInput.d.ts +10 -0
- package/dist/api/types/AssistantMessageInput.js +5 -0
- package/dist/api/types/AssistantMessageOutput.d.ts +9 -0
- package/dist/api/types/AssistantMessageOutput.js +5 -0
- package/dist/api/types/AuthRequest.d.ts +7 -0
- package/dist/api/types/AuthRequest.js +5 -0
- package/dist/api/types/AuthResponse.d.ts +9 -0
- package/dist/api/types/AuthResponse.js +5 -0
- package/dist/api/types/AuthSchemeField.d.ts +16 -0
- package/dist/api/types/AuthSchemeField.js +5 -0
- package/dist/api/types/Block.d.ts +41 -0
- package/dist/api/types/Block.js +5 -0
- package/dist/api/types/BlockUpdate.d.ts +22 -0
- package/dist/api/types/BlockUpdate.js +5 -0
- package/dist/api/types/ChatCompletionRequest.d.ts +29 -0
- package/dist/api/types/ChatCompletionRequest.js +5 -0
- package/dist/api/types/ChatCompletionRequestFunctionCall.d.ts +5 -0
- package/dist/api/types/ChatCompletionRequestFunctionCall.js +5 -0
- package/dist/api/types/ChatCompletionRequestMessagesItem.d.ts +5 -0
- package/dist/api/types/ChatCompletionRequestMessagesItem.js +5 -0
- package/dist/api/types/ChatCompletionRequestStop.d.ts +4 -0
- package/dist/api/types/ChatCompletionRequestStop.js +5 -0
- package/dist/api/types/ChatCompletionRequestToolChoice.d.ts +5 -0
- package/dist/api/types/ChatCompletionRequestToolChoice.js +5 -0
- package/dist/api/types/ChatCompletionResponse.d.ts +16 -0
- package/dist/api/types/ChatCompletionResponse.js +5 -0
- package/dist/api/types/ChildToolRule.d.ts +14 -0
- package/dist/api/types/ChildToolRule.js +5 -0
- package/dist/api/types/Choice.d.ts +11 -0
- package/dist/api/types/Choice.js +5 -0
- package/dist/api/types/ConditionalToolRule.d.ts +18 -0
- package/dist/api/types/ConditionalToolRule.js +5 -0
- package/dist/api/types/ConflictErrorBody.d.ts +6 -0
- package/dist/api/types/ConflictErrorBody.js +5 -0
- package/dist/api/types/ContextWindowOverview.d.ts +41 -0
- package/dist/api/types/ContextWindowOverview.js +5 -0
- package/dist/api/types/CreateAssistantFileRequest.d.ts +7 -0
- package/dist/api/types/CreateAssistantFileRequest.js +5 -0
- package/dist/api/types/CreateAssistantRequest.d.ts +21 -0
- package/dist/api/types/CreateAssistantRequest.js +5 -0
- package/dist/api/types/CreateBlock.d.ts +21 -0
- package/dist/api/types/CreateBlock.js +5 -0
- package/dist/api/types/DeleteAssistantFileResponse.d.ts +10 -0
- package/dist/api/types/DeleteAssistantFileResponse.js +5 -0
- package/dist/api/types/DeleteAssistantResponse.d.ts +10 -0
- package/dist/api/types/DeleteAssistantResponse.js +5 -0
- package/dist/api/types/E2BSandboxConfig.d.ts +11 -0
- package/dist/api/types/E2BSandboxConfig.js +5 -0
- package/dist/api/types/EmbeddingConfig.d.ts +37 -0
- package/dist/api/types/EmbeddingConfig.js +5 -0
- package/dist/api/types/EmbeddingConfigEmbeddingEndpointType.d.ts +26 -0
- package/dist/api/types/EmbeddingConfigEmbeddingEndpointType.js +25 -0
- package/dist/api/types/FileMetadata.d.ts +32 -0
- package/dist/api/types/FileMetadata.js +5 -0
- package/dist/api/types/FunctionCallInput.d.ts +6 -0
- package/dist/api/types/FunctionCallInput.js +5 -0
- package/dist/api/types/FunctionCallOutput.d.ts +7 -0
- package/dist/api/types/FunctionCallOutput.js +5 -0
- package/dist/api/types/FunctionSchema.d.ts +8 -0
- package/dist/api/types/FunctionSchema.js +5 -0
- package/dist/api/types/Health.d.ts +10 -0
- package/dist/api/types/Health.js +5 -0
- package/dist/api/types/HttpValidationError.d.ts +7 -0
- package/dist/api/types/HttpValidationError.js +5 -0
- package/dist/api/types/InitToolRule.d.ts +12 -0
- package/dist/api/types/InitToolRule.js +5 -0
- package/dist/api/types/InternalServerErrorBody.d.ts +6 -0
- package/dist/api/types/InternalServerErrorBody.js +5 -0
- package/dist/api/types/Job.d.ts +34 -0
- package/dist/api/types/Job.js +5 -0
- package/dist/api/types/JobStatus.d.ts +14 -0
- package/dist/api/types/JobStatus.js +13 -0
- package/dist/api/types/LettaRequest.d.ts +12 -0
- package/dist/api/types/LettaRequest.js +5 -0
- package/dist/api/types/LettaResponse.d.ts +68 -0
- package/dist/api/types/LettaResponse.js +5 -0
- package/dist/api/types/LettaResponseAssistantMessage.d.ts +9 -0
- package/dist/api/types/LettaResponseAssistantMessage.js +5 -0
- package/dist/api/types/LettaResponseLettaUsageStatistics.d.ts +22 -0
- package/dist/api/types/LettaResponseLettaUsageStatistics.js +5 -0
- package/dist/api/types/LettaResponseReasoningMessage.d.ts +17 -0
- package/dist/api/types/LettaResponseReasoningMessage.js +5 -0
- package/dist/api/types/LettaResponseSystemMessage.d.ts +17 -0
- package/dist/api/types/LettaResponseSystemMessage.js +5 -0
- package/dist/api/types/LettaResponseToolCall.d.ts +8 -0
- package/dist/api/types/LettaResponseToolCall.js +5 -0
- package/dist/api/types/LettaResponseToolCallDelta.d.ts +8 -0
- package/dist/api/types/LettaResponseToolCallDelta.js +5 -0
- package/dist/api/types/LettaResponseToolCallMessage.d.ts +18 -0
- package/dist/api/types/LettaResponseToolCallMessage.js +5 -0
- package/dist/api/types/LettaResponseToolCallMessageToolCall.d.ts +5 -0
- package/dist/api/types/LettaResponseToolCallMessageToolCall.js +5 -0
- package/dist/api/types/LettaResponseToolCallMessageToolCallOne.d.ts +8 -0
- package/dist/api/types/LettaResponseToolCallMessageToolCallOne.js +5 -0
- package/dist/api/types/LettaResponseToolCallMessageToolCallZero.d.ts +8 -0
- package/dist/api/types/LettaResponseToolCallMessageToolCallZero.js +5 -0
- package/dist/api/types/LettaResponseToolReturnMessage.d.ts +26 -0
- package/dist/api/types/LettaResponseToolReturnMessage.js +5 -0
- package/dist/api/types/LettaResponseToolReturnMessageStatus.d.ts +8 -0
- package/dist/api/types/LettaResponseToolReturnMessageStatus.js +10 -0
- package/dist/api/types/LettaResponseUserMessage.d.ts +17 -0
- package/dist/api/types/LettaResponseUserMessage.js +5 -0
- package/dist/api/types/LettaSchemasLettaMessageToolCall.d.ts +8 -0
- package/dist/api/types/LettaSchemasLettaMessageToolCall.js +5 -0
- package/dist/api/types/LettaSchemasMessageMessage.d.ts +47 -0
- package/dist/api/types/LettaSchemasMessageMessage.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionRequestTool.d.ts +8 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionRequestTool.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionRequestToolCall.d.ts +9 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionRequestToolCall.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.d.ts +7 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionRequestToolCallFunction.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionResponseMessage.d.ts +10 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionResponseMessage.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionResponseToolCall.d.ts +9 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionResponseToolCall.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.d.ts +9 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionsToolCallFunction.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionsToolCallInput.d.ts +11 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionsToolCallInput.js +5 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.d.ts +11 -0
- package/dist/api/types/LettaSchemasOpenaiChatCompletionsToolCallOutput.js +5 -0
- package/dist/api/types/LettaSchemasToolTool.d.ts +39 -0
- package/dist/api/types/LettaSchemasToolTool.js +5 -0
- package/dist/api/types/LettaUsageStatistics.d.ts +22 -0
- package/dist/api/types/LettaUsageStatistics.js +5 -0
- package/dist/api/types/LlmConfig.d.ts +31 -0
- package/dist/api/types/LlmConfig.js +5 -0
- package/dist/api/types/LlmConfigModelEndpointType.d.ts +26 -0
- package/dist/api/types/LlmConfigModelEndpointType.js +25 -0
- package/dist/api/types/LocalSandboxConfig.d.ts +11 -0
- package/dist/api/types/LocalSandboxConfig.js +5 -0
- package/dist/api/types/LogProbToken.d.ts +8 -0
- package/dist/api/types/LogProbToken.js +5 -0
- package/dist/api/types/Memory.d.ts +13 -0
- package/dist/api/types/Memory.js +5 -0
- package/dist/api/types/MessageContentLogProb.d.ts +10 -0
- package/dist/api/types/MessageContentLogProb.js +5 -0
- package/dist/api/types/MessageCreate.d.ts +15 -0
- package/dist/api/types/MessageCreate.js +5 -0
- package/dist/api/types/MessageCreateRole.d.ts +11 -0
- package/dist/api/types/MessageCreateRole.js +10 -0
- package/dist/api/types/MessageRole.d.ts +11 -0
- package/dist/api/types/MessageRole.js +13 -0
- package/dist/api/types/NotFoundErrorBody.d.ts +7 -0
- package/dist/api/types/NotFoundErrorBody.js +5 -0
- package/dist/api/types/NotFoundErrorBodyMessage.d.ts +8 -0
- package/dist/api/types/NotFoundErrorBodyMessage.js +10 -0
- package/dist/api/types/OpenAiAssistant.d.ts +27 -0
- package/dist/api/types/OpenAiAssistant.js +5 -0
- package/dist/api/types/Organization.d.ts +11 -0
- package/dist/api/types/Organization.js +5 -0
- package/dist/api/types/OrganizationCreate.d.ts +7 -0
- package/dist/api/types/OrganizationCreate.js +5 -0
- package/dist/api/types/Passage.d.ts +47 -0
- package/dist/api/types/Passage.js +5 -0
- package/dist/api/types/ReasoningMessage.d.ts +17 -0
- package/dist/api/types/ReasoningMessage.js +5 -0
- package/dist/api/types/RecallMemorySummary.d.ts +7 -0
- package/dist/api/types/RecallMemorySummary.js +5 -0
- package/dist/api/types/ResponseFormat.d.ts +6 -0
- package/dist/api/types/ResponseFormat.js +5 -0
- package/dist/api/types/SandboxConfig.d.ts +22 -0
- package/dist/api/types/SandboxConfig.js +5 -0
- package/dist/api/types/SandboxConfigCreate.d.ts +8 -0
- package/dist/api/types/SandboxConfigCreate.js +5 -0
- package/dist/api/types/SandboxConfigCreateConfig.d.ts +8 -0
- package/dist/api/types/SandboxConfigCreateConfig.js +5 -0
- package/dist/api/types/SandboxConfigUpdate.d.ts +11 -0
- package/dist/api/types/SandboxConfigUpdate.js +5 -0
- package/dist/api/types/SandboxConfigUpdateConfig.d.ts +8 -0
- package/dist/api/types/SandboxConfigUpdateConfig.js +5 -0
- package/dist/api/types/SandboxEnvironmentVariable.d.ts +25 -0
- package/dist/api/types/SandboxEnvironmentVariable.js +5 -0
- package/dist/api/types/SandboxEnvironmentVariableCreate.d.ts +11 -0
- package/dist/api/types/SandboxEnvironmentVariableCreate.js +5 -0
- package/dist/api/types/SandboxEnvironmentVariableUpdate.d.ts +14 -0
- package/dist/api/types/SandboxEnvironmentVariableUpdate.js +5 -0
- package/dist/api/types/SandboxType.d.ts +8 -0
- package/dist/api/types/SandboxType.js +10 -0
- package/dist/api/types/Source.d.ts +37 -0
- package/dist/api/types/Source.js +5 -0
- package/dist/api/types/SystemMessageInput.d.ts +8 -0
- package/dist/api/types/SystemMessageInput.js +5 -0
- package/dist/api/types/SystemMessageOutput.d.ts +17 -0
- package/dist/api/types/SystemMessageOutput.js +5 -0
- package/dist/api/types/TerminalToolRule.d.ts +12 -0
- package/dist/api/types/TerminalToolRule.js +5 -0
- package/dist/api/types/ToolCallDelta.d.ts +8 -0
- package/dist/api/types/ToolCallDelta.js +5 -0
- package/dist/api/types/ToolCallFunctionOutput.d.ts +9 -0
- package/dist/api/types/ToolCallFunctionOutput.js +5 -0
- package/dist/api/types/ToolCallMessage.d.ts +18 -0
- package/dist/api/types/ToolCallMessage.js +5 -0
- package/dist/api/types/ToolCallMessageToolCall.d.ts +5 -0
- package/dist/api/types/ToolCallMessageToolCall.js +5 -0
- package/dist/api/types/ToolCreate.d.ts +21 -0
- package/dist/api/types/ToolCreate.js +5 -0
- package/dist/api/types/ToolFunctionChoice.d.ts +8 -0
- package/dist/api/types/ToolFunctionChoice.js +5 -0
- package/dist/api/types/ToolInput.d.ts +8 -0
- package/dist/api/types/ToolInput.js +5 -0
- package/dist/api/types/ToolMessage.d.ts +8 -0
- package/dist/api/types/ToolMessage.js +5 -0
- package/dist/api/types/ToolReturnMessage.d.ts +26 -0
- package/dist/api/types/ToolReturnMessage.js +5 -0
- package/dist/api/types/ToolReturnMessageStatus.d.ts +8 -0
- package/dist/api/types/ToolReturnMessageStatus.js +10 -0
- package/dist/api/types/ToolRuleType.d.ts +15 -0
- package/dist/api/types/ToolRuleType.js +14 -0
- package/dist/api/types/UsageStatistics.d.ts +8 -0
- package/dist/api/types/UsageStatistics.js +5 -0
- package/dist/api/types/User.d.ts +25 -0
- package/dist/api/types/User.js +5 -0
- package/dist/api/types/UserCreate.d.ts +9 -0
- package/dist/api/types/UserCreate.js +5 -0
- package/dist/api/types/UserMessageInput.d.ts +9 -0
- package/dist/api/types/UserMessageInput.js +5 -0
- package/dist/api/types/UserMessageInputContent.d.ts +4 -0
- package/dist/api/types/UserMessageInputContent.js +5 -0
- package/dist/api/types/UserMessageOutput.d.ts +17 -0
- package/dist/api/types/UserMessageOutput.js +5 -0
- package/dist/api/types/UserUpdate.d.ts +11 -0
- package/dist/api/types/UserUpdate.js +5 -0
- package/dist/api/types/ValidationError.d.ts +9 -0
- package/dist/api/types/ValidationError.js +5 -0
- package/dist/api/types/ValidationErrorLocItem.d.ts +4 -0
- package/dist/api/types/ValidationErrorLocItem.js +5 -0
- package/dist/api/types/index.d.ts +125 -0
- package/dist/api/types/index.js +141 -0
- package/dist/core/auth/BasicAuth.d.ts +8 -0
- package/dist/core/auth/BasicAuth.js +26 -0
- package/dist/core/auth/BearerToken.d.ts +5 -0
- package/dist/core/auth/BearerToken.js +15 -0
- package/dist/core/auth/index.d.ts +2 -0
- package/dist/core/auth/index.js +7 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.d.ts +39 -0
- package/dist/core/fetcher/Fetcher.js +99 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +12 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +55 -0
- package/dist/core/fetcher/index.d.ts +5 -0
- package/dist/core/fetcher/index.js +9 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +41 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +60 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +174 -0
- package/dist/core/form-data-utils/index.d.ts +1 -0
- package/dist/core/form-data-utils/index.js +17 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +21 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +93 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
- package/dist/core/streaming-fetcher/Stream.js +170 -0
- package/dist/core/streaming-fetcher/index.d.ts +1 -0
- package/dist/core/streaming-fetcher/index.js +5 -0
- package/dist/environments.d.ts +8 -0
- package/dist/environments.js +10 -0
- package/dist/errors/LettaError.d.ts +12 -0
- package/dist/errors/LettaError.js +32 -0
- package/dist/errors/LettaTimeoutError.d.ts +6 -0
- package/dist/errors/LettaTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +34 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +8 -0
- package/environments.js +10 -0
- package/errors/LettaError.d.ts +12 -0
- package/errors/LettaError.js +32 -0
- package/errors/LettaTimeoutError.d.ts +6 -0
- package/errors/LettaTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +7 -0
- package/index.d.ts +4 -0
- package/index.js +34 -0
- package/jest.config.js +5 -0
- package/package.json +42 -10
- package/reference.md +4296 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
38
|
+
var t = {};
|
|
39
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
40
|
+
t[p] = s[p];
|
|
41
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
42
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
43
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
44
|
+
t[p[i]] = s[p[i]];
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
};
|
|
48
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
49
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.Agents = void 0;
|
|
53
|
+
const environments = __importStar(require("../../../../environments"));
|
|
54
|
+
const core = __importStar(require("../../../../core"));
|
|
55
|
+
const Letta = __importStar(require("../../../index"));
|
|
56
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
57
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
58
|
+
const Client_1 = require("../resources/context/client/Client");
|
|
59
|
+
const Client_2 = require("../resources/tools/client/Client");
|
|
60
|
+
const Client_3 = require("../resources/sources/client/Client");
|
|
61
|
+
const Client_4 = require("../resources/memory/client/Client");
|
|
62
|
+
const Client_5 = require("../resources/memoryBlocks/client/Client");
|
|
63
|
+
const Client_6 = require("../resources/recallMemory/client/Client");
|
|
64
|
+
const Client_7 = require("../resources/archivalMemory/client/Client");
|
|
65
|
+
const Client_8 = require("../resources/messages/client/Client");
|
|
66
|
+
class Agents {
|
|
67
|
+
constructor(_options) {
|
|
68
|
+
this._options = _options;
|
|
69
|
+
}
|
|
70
|
+
get context() {
|
|
71
|
+
var _a;
|
|
72
|
+
return ((_a = this._context) !== null && _a !== void 0 ? _a : (this._context = new Client_1.Context(this._options)));
|
|
73
|
+
}
|
|
74
|
+
get tools() {
|
|
75
|
+
var _a;
|
|
76
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_2.Tools(this._options)));
|
|
77
|
+
}
|
|
78
|
+
get sources() {
|
|
79
|
+
var _a;
|
|
80
|
+
return ((_a = this._sources) !== null && _a !== void 0 ? _a : (this._sources = new Client_3.Sources(this._options)));
|
|
81
|
+
}
|
|
82
|
+
get memory() {
|
|
83
|
+
var _a;
|
|
84
|
+
return ((_a = this._memory) !== null && _a !== void 0 ? _a : (this._memory = new Client_4.Memory(this._options)));
|
|
85
|
+
}
|
|
86
|
+
get memoryBlocks() {
|
|
87
|
+
var _a;
|
|
88
|
+
return ((_a = this._memoryBlocks) !== null && _a !== void 0 ? _a : (this._memoryBlocks = new Client_5.MemoryBlocks(this._options)));
|
|
89
|
+
}
|
|
90
|
+
get recallMemory() {
|
|
91
|
+
var _a;
|
|
92
|
+
return ((_a = this._recallMemory) !== null && _a !== void 0 ? _a : (this._recallMemory = new Client_6.RecallMemory(this._options)));
|
|
93
|
+
}
|
|
94
|
+
get archivalMemory() {
|
|
95
|
+
var _a;
|
|
96
|
+
return ((_a = this._archivalMemory) !== null && _a !== void 0 ? _a : (this._archivalMemory = new Client_7.ArchivalMemory(this._options)));
|
|
97
|
+
}
|
|
98
|
+
get messages() {
|
|
99
|
+
var _a;
|
|
100
|
+
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_8.Messages(this._options)));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* List all agents associated with a given user.
|
|
104
|
+
* This endpoint retrieves a list of all agents and their configurations associated with the specified user ID.
|
|
105
|
+
*
|
|
106
|
+
* @param {Letta.AgentsListRequest} request
|
|
107
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* await client.agents.list()
|
|
113
|
+
*/
|
|
114
|
+
list(request = {}, requestOptions) {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
const { name, tags, match_all_tags: matchAllTags } = request;
|
|
118
|
+
const _queryParams = {};
|
|
119
|
+
if (name != null) {
|
|
120
|
+
_queryParams["name"] = name;
|
|
121
|
+
}
|
|
122
|
+
if (tags != null) {
|
|
123
|
+
if (Array.isArray(tags)) {
|
|
124
|
+
_queryParams["tags"] = tags.map((item) => item);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
_queryParams["tags"] = tags;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (matchAllTags != null) {
|
|
131
|
+
_queryParams["match_all_tags"] = matchAllTags.toString();
|
|
132
|
+
}
|
|
133
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
134
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, "v1/agents/"),
|
|
135
|
+
method: "GET",
|
|
136
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
137
|
+
contentType: "application/json",
|
|
138
|
+
queryParameters: _queryParams,
|
|
139
|
+
requestType: "json",
|
|
140
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
141
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
142
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
143
|
+
});
|
|
144
|
+
if (_response.ok) {
|
|
145
|
+
return _response.body;
|
|
146
|
+
}
|
|
147
|
+
if (_response.error.reason === "status-code") {
|
|
148
|
+
switch (_response.error.statusCode) {
|
|
149
|
+
case 422:
|
|
150
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
151
|
+
default:
|
|
152
|
+
throw new errors.LettaError({
|
|
153
|
+
statusCode: _response.error.statusCode,
|
|
154
|
+
body: _response.error.body,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
switch (_response.error.reason) {
|
|
159
|
+
case "non-json":
|
|
160
|
+
throw new errors.LettaError({
|
|
161
|
+
statusCode: _response.error.statusCode,
|
|
162
|
+
body: _response.error.rawBody,
|
|
163
|
+
});
|
|
164
|
+
case "timeout":
|
|
165
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/.");
|
|
166
|
+
case "unknown":
|
|
167
|
+
throw new errors.LettaError({
|
|
168
|
+
message: _response.error.errorMessage,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Create a new agent with the specified configuration.
|
|
175
|
+
*
|
|
176
|
+
* @param {Letta.CreateAgentRequest} request
|
|
177
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
178
|
+
*
|
|
179
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* await client.agents.create({
|
|
183
|
+
* memory_blocks: [{
|
|
184
|
+
* value: "value",
|
|
185
|
+
* label: "label"
|
|
186
|
+
* }]
|
|
187
|
+
* })
|
|
188
|
+
*/
|
|
189
|
+
create(request, requestOptions) {
|
|
190
|
+
var _a, _b;
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
193
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, "v1/agents/"),
|
|
194
|
+
method: "POST",
|
|
195
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
196
|
+
contentType: "application/json",
|
|
197
|
+
requestType: "json",
|
|
198
|
+
body: request,
|
|
199
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
200
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
201
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
202
|
+
});
|
|
203
|
+
if (_response.ok) {
|
|
204
|
+
return _response.body;
|
|
205
|
+
}
|
|
206
|
+
if (_response.error.reason === "status-code") {
|
|
207
|
+
switch (_response.error.statusCode) {
|
|
208
|
+
case 422:
|
|
209
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
210
|
+
default:
|
|
211
|
+
throw new errors.LettaError({
|
|
212
|
+
statusCode: _response.error.statusCode,
|
|
213
|
+
body: _response.error.body,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
switch (_response.error.reason) {
|
|
218
|
+
case "non-json":
|
|
219
|
+
throw new errors.LettaError({
|
|
220
|
+
statusCode: _response.error.statusCode,
|
|
221
|
+
body: _response.error.rawBody,
|
|
222
|
+
});
|
|
223
|
+
case "timeout":
|
|
224
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/.");
|
|
225
|
+
case "unknown":
|
|
226
|
+
throw new errors.LettaError({
|
|
227
|
+
message: _response.error.errorMessage,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get the state of the agent.
|
|
234
|
+
*
|
|
235
|
+
* @param {string} agentId
|
|
236
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
237
|
+
*
|
|
238
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* await client.agents.get("agent_id")
|
|
242
|
+
*/
|
|
243
|
+
get(agentId, requestOptions) {
|
|
244
|
+
var _a, _b;
|
|
245
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
246
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
247
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
248
|
+
method: "GET",
|
|
249
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
250
|
+
contentType: "application/json",
|
|
251
|
+
requestType: "json",
|
|
252
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
253
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
254
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
255
|
+
});
|
|
256
|
+
if (_response.ok) {
|
|
257
|
+
return _response.body;
|
|
258
|
+
}
|
|
259
|
+
if (_response.error.reason === "status-code") {
|
|
260
|
+
switch (_response.error.statusCode) {
|
|
261
|
+
case 422:
|
|
262
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
263
|
+
default:
|
|
264
|
+
throw new errors.LettaError({
|
|
265
|
+
statusCode: _response.error.statusCode,
|
|
266
|
+
body: _response.error.body,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
switch (_response.error.reason) {
|
|
271
|
+
case "non-json":
|
|
272
|
+
throw new errors.LettaError({
|
|
273
|
+
statusCode: _response.error.statusCode,
|
|
274
|
+
body: _response.error.rawBody,
|
|
275
|
+
});
|
|
276
|
+
case "timeout":
|
|
277
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}.");
|
|
278
|
+
case "unknown":
|
|
279
|
+
throw new errors.LettaError({
|
|
280
|
+
message: _response.error.errorMessage,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Delete an agent.
|
|
287
|
+
*
|
|
288
|
+
* @param {string} agentId
|
|
289
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
290
|
+
*
|
|
291
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* await client.agents.delete("agent_id")
|
|
295
|
+
*/
|
|
296
|
+
delete(agentId, requestOptions) {
|
|
297
|
+
var _a, _b;
|
|
298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
300
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
301
|
+
method: "DELETE",
|
|
302
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
303
|
+
contentType: "application/json",
|
|
304
|
+
requestType: "json",
|
|
305
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
306
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
307
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
308
|
+
});
|
|
309
|
+
if (_response.ok) {
|
|
310
|
+
return _response.body;
|
|
311
|
+
}
|
|
312
|
+
if (_response.error.reason === "status-code") {
|
|
313
|
+
switch (_response.error.statusCode) {
|
|
314
|
+
case 422:
|
|
315
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
316
|
+
default:
|
|
317
|
+
throw new errors.LettaError({
|
|
318
|
+
statusCode: _response.error.statusCode,
|
|
319
|
+
body: _response.error.body,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
switch (_response.error.reason) {
|
|
324
|
+
case "non-json":
|
|
325
|
+
throw new errors.LettaError({
|
|
326
|
+
statusCode: _response.error.statusCode,
|
|
327
|
+
body: _response.error.rawBody,
|
|
328
|
+
});
|
|
329
|
+
case "timeout":
|
|
330
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/agents/{agent_id}.");
|
|
331
|
+
case "unknown":
|
|
332
|
+
throw new errors.LettaError({
|
|
333
|
+
message: _response.error.errorMessage,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Update an exsiting agent
|
|
340
|
+
*
|
|
341
|
+
* @param {string} agentId
|
|
342
|
+
* @param {Letta.UpdateAgent} request
|
|
343
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
344
|
+
*
|
|
345
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
* await client.agents.update("agent_id")
|
|
349
|
+
*/
|
|
350
|
+
update(agentId, request = {}, requestOptions) {
|
|
351
|
+
var _a, _b;
|
|
352
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
353
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
354
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}`),
|
|
355
|
+
method: "PATCH",
|
|
356
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
357
|
+
contentType: "application/json",
|
|
358
|
+
requestType: "json",
|
|
359
|
+
body: request,
|
|
360
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
361
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
362
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
363
|
+
});
|
|
364
|
+
if (_response.ok) {
|
|
365
|
+
return _response.body;
|
|
366
|
+
}
|
|
367
|
+
if (_response.error.reason === "status-code") {
|
|
368
|
+
switch (_response.error.statusCode) {
|
|
369
|
+
case 422:
|
|
370
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
371
|
+
default:
|
|
372
|
+
throw new errors.LettaError({
|
|
373
|
+
statusCode: _response.error.statusCode,
|
|
374
|
+
body: _response.error.body,
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
switch (_response.error.reason) {
|
|
379
|
+
case "non-json":
|
|
380
|
+
throw new errors.LettaError({
|
|
381
|
+
statusCode: _response.error.statusCode,
|
|
382
|
+
body: _response.error.rawBody,
|
|
383
|
+
});
|
|
384
|
+
case "timeout":
|
|
385
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}.");
|
|
386
|
+
case "unknown":
|
|
387
|
+
throw new errors.LettaError({
|
|
388
|
+
message: _response.error.errorMessage,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Retrieve a memory block from an agent.
|
|
395
|
+
*
|
|
396
|
+
* @param {string} agentId
|
|
397
|
+
* @param {string} blockLabel
|
|
398
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
399
|
+
*
|
|
400
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* await client.agents.getAgentMemoryBlock("agent_id", "block_label")
|
|
404
|
+
*/
|
|
405
|
+
getAgentMemoryBlock(agentId, blockLabel, requestOptions) {
|
|
406
|
+
var _a, _b;
|
|
407
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
408
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
409
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}/memory/block/${encodeURIComponent(blockLabel)}`),
|
|
410
|
+
method: "GET",
|
|
411
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
412
|
+
contentType: "application/json",
|
|
413
|
+
requestType: "json",
|
|
414
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
415
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
416
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
417
|
+
});
|
|
418
|
+
if (_response.ok) {
|
|
419
|
+
return _response.body;
|
|
420
|
+
}
|
|
421
|
+
if (_response.error.reason === "status-code") {
|
|
422
|
+
switch (_response.error.statusCode) {
|
|
423
|
+
case 422:
|
|
424
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
425
|
+
default:
|
|
426
|
+
throw new errors.LettaError({
|
|
427
|
+
statusCode: _response.error.statusCode,
|
|
428
|
+
body: _response.error.body,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
switch (_response.error.reason) {
|
|
433
|
+
case "non-json":
|
|
434
|
+
throw new errors.LettaError({
|
|
435
|
+
statusCode: _response.error.statusCode,
|
|
436
|
+
body: _response.error.rawBody,
|
|
437
|
+
});
|
|
438
|
+
case "timeout":
|
|
439
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/memory/block/{block_label}.");
|
|
440
|
+
case "unknown":
|
|
441
|
+
throw new errors.LettaError({
|
|
442
|
+
message: _response.error.errorMessage,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Removes a memory block from an agent by unlnking it. If the block is not linked to any other agent, it is deleted.
|
|
449
|
+
*
|
|
450
|
+
* @param {string} agentId
|
|
451
|
+
* @param {string} blockLabel
|
|
452
|
+
* @param {Letta.BlockUpdate} request
|
|
453
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
454
|
+
*
|
|
455
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* await client.agents.updateAgentMemoryBlockByLabel("agent_id", "block_label", {})
|
|
459
|
+
*/
|
|
460
|
+
updateAgentMemoryBlockByLabel(agentId, blockLabel, request, requestOptions) {
|
|
461
|
+
var _a, _b;
|
|
462
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
463
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
464
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}/memory/block/${encodeURIComponent(blockLabel)}`),
|
|
465
|
+
method: "PATCH",
|
|
466
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
467
|
+
contentType: "application/json",
|
|
468
|
+
requestType: "json",
|
|
469
|
+
body: request,
|
|
470
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
471
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
472
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
473
|
+
});
|
|
474
|
+
if (_response.ok) {
|
|
475
|
+
return _response.body;
|
|
476
|
+
}
|
|
477
|
+
if (_response.error.reason === "status-code") {
|
|
478
|
+
switch (_response.error.statusCode) {
|
|
479
|
+
case 422:
|
|
480
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
481
|
+
default:
|
|
482
|
+
throw new errors.LettaError({
|
|
483
|
+
statusCode: _response.error.statusCode,
|
|
484
|
+
body: _response.error.body,
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
switch (_response.error.reason) {
|
|
489
|
+
case "non-json":
|
|
490
|
+
throw new errors.LettaError({
|
|
491
|
+
statusCode: _response.error.statusCode,
|
|
492
|
+
body: _response.error.rawBody,
|
|
493
|
+
});
|
|
494
|
+
case "timeout":
|
|
495
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling PATCH /v1/agents/{agent_id}/memory/block/{block_label}.");
|
|
496
|
+
case "unknown":
|
|
497
|
+
throw new errors.LettaError({
|
|
498
|
+
message: _response.error.errorMessage,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Retrieve the memory blocks of a specific agent.
|
|
505
|
+
*
|
|
506
|
+
* @param {string} agentId
|
|
507
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
508
|
+
*
|
|
509
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* await client.agents.getAgentMemoryBlocks("agent_id")
|
|
513
|
+
*/
|
|
514
|
+
getAgentMemoryBlocks(agentId, requestOptions) {
|
|
515
|
+
var _a, _b;
|
|
516
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
517
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
518
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}/memory/block`),
|
|
519
|
+
method: "GET",
|
|
520
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
521
|
+
contentType: "application/json",
|
|
522
|
+
requestType: "json",
|
|
523
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
524
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
525
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
526
|
+
});
|
|
527
|
+
if (_response.ok) {
|
|
528
|
+
return _response.body;
|
|
529
|
+
}
|
|
530
|
+
if (_response.error.reason === "status-code") {
|
|
531
|
+
switch (_response.error.statusCode) {
|
|
532
|
+
case 422:
|
|
533
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
534
|
+
default:
|
|
535
|
+
throw new errors.LettaError({
|
|
536
|
+
statusCode: _response.error.statusCode,
|
|
537
|
+
body: _response.error.body,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
switch (_response.error.reason) {
|
|
542
|
+
case "non-json":
|
|
543
|
+
throw new errors.LettaError({
|
|
544
|
+
statusCode: _response.error.statusCode,
|
|
545
|
+
body: _response.error.rawBody,
|
|
546
|
+
});
|
|
547
|
+
case "timeout":
|
|
548
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/agents/{agent_id}/memory/block.");
|
|
549
|
+
case "unknown":
|
|
550
|
+
throw new errors.LettaError({
|
|
551
|
+
message: _response.error.errorMessage,
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Asynchronously process a user message and return a job ID.
|
|
558
|
+
* The actual processing happens in the background, and the status can be checked using the job ID.
|
|
559
|
+
*
|
|
560
|
+
* @param {string} agentId
|
|
561
|
+
* @param {Letta.LettaRequest} request
|
|
562
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
563
|
+
*
|
|
564
|
+
* @throws {@link Letta.UnprocessableEntityError}
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* await client.agents.createAgentMessageAsync("agent_id", {
|
|
568
|
+
* messages: [{
|
|
569
|
+
* role: "user",
|
|
570
|
+
* text: "text"
|
|
571
|
+
* }]
|
|
572
|
+
* })
|
|
573
|
+
*/
|
|
574
|
+
createAgentMessageAsync(agentId, request, requestOptions) {
|
|
575
|
+
var _a, _b;
|
|
576
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
577
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
578
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}/messages/async`),
|
|
579
|
+
method: "POST",
|
|
580
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
581
|
+
contentType: "application/json",
|
|
582
|
+
requestType: "json",
|
|
583
|
+
body: request,
|
|
584
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
585
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
586
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
587
|
+
});
|
|
588
|
+
if (_response.ok) {
|
|
589
|
+
return _response.body;
|
|
590
|
+
}
|
|
591
|
+
if (_response.error.reason === "status-code") {
|
|
592
|
+
switch (_response.error.statusCode) {
|
|
593
|
+
case 422:
|
|
594
|
+
throw new Letta.UnprocessableEntityError(_response.error.body);
|
|
595
|
+
default:
|
|
596
|
+
throw new errors.LettaError({
|
|
597
|
+
statusCode: _response.error.statusCode,
|
|
598
|
+
body: _response.error.body,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
switch (_response.error.reason) {
|
|
603
|
+
case "non-json":
|
|
604
|
+
throw new errors.LettaError({
|
|
605
|
+
statusCode: _response.error.statusCode,
|
|
606
|
+
body: _response.error.rawBody,
|
|
607
|
+
});
|
|
608
|
+
case "timeout":
|
|
609
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/messages/async.");
|
|
610
|
+
case "unknown":
|
|
611
|
+
throw new errors.LettaError({
|
|
612
|
+
message: _response.error.errorMessage,
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Creates a versioned version of an agent
|
|
619
|
+
*
|
|
620
|
+
* @param {string} agentId - The agent ID of the agent to migrate, if this agent is not a template, it will create a agent template from the agent provided as well
|
|
621
|
+
* @param {Letta.AgentsCreateVersionRequest} request
|
|
622
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
623
|
+
*
|
|
624
|
+
* @throws {@link Letta.NotFoundError}
|
|
625
|
+
* @throws {@link Letta.InternalServerError}
|
|
626
|
+
*
|
|
627
|
+
* @example
|
|
628
|
+
* await client.agents.createVersion("agent_id")
|
|
629
|
+
*/
|
|
630
|
+
createVersion(agentId, request = {}, requestOptions) {
|
|
631
|
+
var _a, _b;
|
|
632
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
633
|
+
const { returnAgentId } = request, _body = __rest(request, ["returnAgentId"]);
|
|
634
|
+
const _queryParams = {};
|
|
635
|
+
if (returnAgentId != null) {
|
|
636
|
+
_queryParams["returnAgentId"] = returnAgentId.toString();
|
|
637
|
+
}
|
|
638
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
639
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}/version-template`),
|
|
640
|
+
method: "POST",
|
|
641
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
642
|
+
contentType: "application/json",
|
|
643
|
+
queryParameters: _queryParams,
|
|
644
|
+
requestType: "json",
|
|
645
|
+
body: _body,
|
|
646
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
647
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
648
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
649
|
+
});
|
|
650
|
+
if (_response.ok) {
|
|
651
|
+
return _response.body;
|
|
652
|
+
}
|
|
653
|
+
if (_response.error.reason === "status-code") {
|
|
654
|
+
switch (_response.error.statusCode) {
|
|
655
|
+
case 404:
|
|
656
|
+
throw new Letta.NotFoundError(_response.error.body);
|
|
657
|
+
case 500:
|
|
658
|
+
throw new Letta.InternalServerError(_response.error.body);
|
|
659
|
+
default:
|
|
660
|
+
throw new errors.LettaError({
|
|
661
|
+
statusCode: _response.error.statusCode,
|
|
662
|
+
body: _response.error.body,
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
switch (_response.error.reason) {
|
|
667
|
+
case "non-json":
|
|
668
|
+
throw new errors.LettaError({
|
|
669
|
+
statusCode: _response.error.statusCode,
|
|
670
|
+
body: _response.error.rawBody,
|
|
671
|
+
});
|
|
672
|
+
case "timeout":
|
|
673
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/version-template.");
|
|
674
|
+
case "unknown":
|
|
675
|
+
throw new errors.LettaError({
|
|
676
|
+
message: _response.error.errorMessage,
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Migrate an agent to a new versioned agent template
|
|
683
|
+
*
|
|
684
|
+
* @param {string} agentId
|
|
685
|
+
* @param {Letta.AgentsMigrateRequest} request
|
|
686
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
687
|
+
*
|
|
688
|
+
* @throws {@link Letta.NotFoundError}
|
|
689
|
+
* @throws {@link Letta.ConflictError}
|
|
690
|
+
* @throws {@link Letta.InternalServerError}
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* await client.agents.migrate("agent_id", {
|
|
694
|
+
* to_template: "to_template",
|
|
695
|
+
* preserve_core_memories: true
|
|
696
|
+
* })
|
|
697
|
+
*/
|
|
698
|
+
migrate(agentId, request, requestOptions) {
|
|
699
|
+
var _a, _b;
|
|
700
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
702
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.LettaEnvironment.LettaHosted, `v1/agents/${encodeURIComponent(agentId)}/migrate`),
|
|
703
|
+
method: "POST",
|
|
704
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.0-alpha2", "User-Agent": "@letta-ai/letta-client/0.1.0-alpha2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
705
|
+
contentType: "application/json",
|
|
706
|
+
requestType: "json",
|
|
707
|
+
body: request,
|
|
708
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
709
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
710
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
711
|
+
});
|
|
712
|
+
if (_response.ok) {
|
|
713
|
+
return _response.body;
|
|
714
|
+
}
|
|
715
|
+
if (_response.error.reason === "status-code") {
|
|
716
|
+
switch (_response.error.statusCode) {
|
|
717
|
+
case 404:
|
|
718
|
+
throw new Letta.NotFoundError(_response.error.body);
|
|
719
|
+
case 409:
|
|
720
|
+
throw new Letta.ConflictError(_response.error.body);
|
|
721
|
+
case 500:
|
|
722
|
+
throw new Letta.InternalServerError(_response.error.body);
|
|
723
|
+
default:
|
|
724
|
+
throw new errors.LettaError({
|
|
725
|
+
statusCode: _response.error.statusCode,
|
|
726
|
+
body: _response.error.body,
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
switch (_response.error.reason) {
|
|
731
|
+
case "non-json":
|
|
732
|
+
throw new errors.LettaError({
|
|
733
|
+
statusCode: _response.error.statusCode,
|
|
734
|
+
body: _response.error.rawBody,
|
|
735
|
+
});
|
|
736
|
+
case "timeout":
|
|
737
|
+
throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/agents/{agent_id}/migrate.");
|
|
738
|
+
case "unknown":
|
|
739
|
+
throw new errors.LettaError({
|
|
740
|
+
message: _response.error.errorMessage,
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
_getAuthorizationHeader() {
|
|
746
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
747
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
exports.Agents = Agents;
|