From a539c4fe875a45d6cf385a035f7412962f7b0fff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 May 2026 13:15:43 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...gentsClient.AgentsCountDeployedAgents.g.cs | 74 +- ....AgentsClient.AgentsGetAgentVariables.g.cs | 64 +- ...entsClient.AgentsSearchDeployedAgents.g.cs | 66 +- ...tta.AgentsClient.AttachArchiveToAgent.g.cs | 65 +- ...ta.AgentsClient.AttachCoreMemoryBlock.g.cs | 71 +- ...etta.AgentsClient.AttachFolderToAgent.g.cs | 71 +- ...ta.AgentsClient.AttachIdentityToAgent.g.cs | 65 +- .../Letta.AgentsClient.AttachToolToAgent.g.cs | 71 +- .../Letta.AgentsClient.CancelMessage.g.cs | 68 +- ...ta.AgentsClient.CloseAllFilesForAgent.g.cs | 68 +- .../Letta.AgentsClient.CloseFileForAgent.g.cs | 69 +- .../Letta.AgentsClient.CountAgents.g.cs | 122 +- .../Letta.AgentsClient.CreateAgent.g.cs | 71 +- ....AgentsClient.CreateAgentMessageAsync.g.cs | 76 +- .../Letta.AgentsClient.CreatePassage.g.cs | 71 +- .../Letta.AgentsClient.DeleteAgent.g.cs | 62 +- .../Letta.AgentsClient.DeletePassage.g.cs | 65 +- ...a.AgentsClient.DetachArchiveFromAgent.g.cs | 65 +- ...ta.AgentsClient.DetachCoreMemoryBlock.g.cs | 71 +- ...ta.AgentsClient.DetachFolderFromAgent.g.cs | 71 +- ....AgentsClient.DetachIdentityFromAgent.g.cs | 65 +- ...etta.AgentsClient.DetachToolFromAgent.g.cs | 71 +- .../Letta.AgentsClient.ExportAgent.g.cs | 91 +- ...ta.AgentsClient.ExportAgentWithSkills.g.cs | 67 +- ...Letta.AgentsClient.GenerateCompletion.g.cs | 86 +- .../Letta.AgentsClient.ImportAgent.g.cs | 1314 ++++++++++++++++- .../Letta.AgentsClient.ListAgents.g.cs | 172 ++- ...tta.AgentsClient.ListCoreMemoryBlocks.g.cs | 98 +- .../Letta.AgentsClient.ListFilesForAgent.g.cs | 108 +- ...etta.AgentsClient.ListFoldersForAgent.g.cs | 98 +- ...Letta.AgentsClient.ListGroupsForAgent.g.cs | 103 +- .../Letta.AgentsClient.ListMessages.g.cs | 136 +- .../Letta.AgentsClient.ListPassages.g.cs | 97 +- .../Letta.AgentsClient.ListToolsForAgent.g.cs | 98 +- .../Letta.AgentsClient.ModifyAgent.g.cs | 71 +- ...ta.AgentsClient.ModifyApprovalForTool.g.cs | 84 +- ...ta.AgentsClient.ModifyCoreMemoryBlock.g.cs | 74 +- .../Letta.AgentsClient.OpenFileForAgent.g.cs | 74 +- ...etta.AgentsClient.PreviewModelRequest.g.cs | 70 +- .../Letta.AgentsClient.RecompileAgent.g.cs | 78 +- .../Letta.AgentsClient.ResetMessages.g.cs | 71 +- .../Letta.AgentsClient.RetrieveAgent.g.cs | 81 +- ....AgentsClient.RetrieveCoreMemoryBlock.g.cs | 69 +- .../Letta.AgentsClient.RunToolForAgent.g.cs | 76 +- ...tta.AgentsClient.SearchArchivalMemory.g.cs | 104 +- .../Letta.AgentsClient.SearchMessages.g.cs | 67 +- .../Letta.AgentsClient.SendMessage.g.cs | 82 +- .../Letta.AgentsClient.SummarizeMessages.g.cs | 71 +- .../Letta/Generated/Letta.AgentsClient.g.cs | 8 +- .../Letta.ArchivesClient.CreateArchive.g.cs | 66 +- ...ArchivesClient.CreatePassageInArchive.g.cs | 72 +- ...rchivesClient.CreatePassagesInArchive.g.cs | 72 +- .../Letta.ArchivesClient.DeleteArchive.g.cs | 56 +- ...chivesClient.DeletePassageFromArchive.g.cs | 62 +- ...a.ArchivesClient.ListAgentsForArchive.g.cs | 98 +- .../Letta.ArchivesClient.ListArchives.g.cs | 103 +- .../Letta.ArchivesClient.ModifyArchive.g.cs | 71 +- .../Letta.ArchivesClient.RetrieveArchive.g.cs | 66 +- .../Letta/Generated/Letta.ArchivesClient.g.cs | 8 +- .../Generated/Letta.AutoSDKHttpResponse.g.cs | 121 ++ ...ta.BlocksClient.AttachIdentityToBlock.g.cs | 69 +- .../Letta.BlocksClient.CountBlocks.g.cs | 98 +- .../Letta.BlocksClient.CreateBlock.g.cs | 65 +- .../Letta.BlocksClient.DeleteBlock.g.cs | 61 +- ....BlocksClient.DetachIdentityFromBlock.g.cs | 69 +- ...Letta.BlocksClient.ListAgentsForBlock.g.cs | 110 +- .../Letta.BlocksClient.ListBlocks.g.cs | 164 +- .../Letta.BlocksClient.ModifyBlock.g.cs | 70 +- .../Letta.BlocksClient.RetrieveBlock.g.cs | 65 +- .../Letta/Generated/Letta.BlocksClient.g.cs | 8 +- ...Letta.ChatClient.CreateChatCompletion.g.cs | 72 +- .../Letta/Generated/Letta.ChatClient.g.cs | 8 +- ...cessTokensCreateClientSideAccessToken.g.cs | 66 +- ...cessTokensDeleteClientSideAccessToken.g.cs | 65 +- ...ccessTokensListClientSideAccessTokens.g.cs | 78 +- .../Letta.ClientSideAccessTokensClient.g.cs | 8 +- ...onversationsClient.CancelConversation.g.cs | 75 +- ...nversationsClient.CompactConversation.g.cs | 76 +- ...onversationsClient.CreateConversation.g.cs | 75 +- ...onversationsClient.DeleteConversation.g.cs | 65 +- ....ConversationsClient.ForkConversation.g.cs | 81 +- ...ationsClient.ListConversationMessages.g.cs | 123 +- ...ConversationsClient.ListConversations.g.cs | 98 +- ...lient.PreviewConversationModelRequest.g.cs | 71 +- ...ersationsClient.RecompileConversation.g.cs | 77 +- ...versationsClient.RetrieveConversation.g.cs | 66 +- ...ionsClient.RetrieveConversationStream.g.cs | 76 +- ...sationsClient.SendConversationMessage.g.cs | 77 +- ...onversationsClient.UpdateConversation.g.cs | 71 +- .../Generated/Letta.ConversationsClient.g.cs | 8 +- ...ient.DeviceStorageGetDeviceStorageKey.g.cs | 68 +- .../Generated/Letta.DeviceStorageClient.g.cs | 8 +- ....EmbeddingsClient.GetTotalStorageSize.g.cs | 66 +- .../Generated/Letta.EmbeddingsClient.g.cs | 8 +- ...sClient.EnvironmentsDeleteEnvironment.g.cs | 69 +- ...mentsClient.EnvironmentsGetConnection.g.cs | 64 +- ...ntsClient.EnvironmentsListConnections.g.cs | 77 +- ...vironmentsClient.EnvironmentsRegister.g.cs | 66 +- ...onmentsClient.EnvironmentsSendMessage.g.cs | 69 +- .../Generated/Letta.EnvironmentsClient.g.cs | 8 +- ...FeedsClient.FeedsBackfillSubscription.g.cs | 72 +- .../Letta.FeedsClient.FeedsCreateFeed.g.cs | 66 +- .../Letta.FeedsClient.FeedsDeleteFeed.g.cs | 69 +- ...a.FeedsClient.FeedsDeleteSubscription.g.cs | 72 +- .../Letta.FeedsClient.FeedsGetFeed.g.cs | 64 +- .../Letta.FeedsClient.FeedsGetMessage.g.cs | 67 +- .../Letta.FeedsClient.FeedsListFeeds.g.cs | 77 +- .../Letta.FeedsClient.FeedsListMessages.g.cs | 74 +- ...dsClient.FeedsListSubscriptionHistory.g.cs | 77 +- ...ta.FeedsClient.FeedsListSubscriptions.g.cs | 77 +- ...etta.FeedsClient.FeedsPublishMessages.g.cs | 69 +- ...Letta.FeedsClient.FeedsSubscribeAgent.g.cs | 69 +- ....FeedsClient.FeedsTriggerSubscription.g.cs | 72 +- ...tta.FeedsClient.FeedsUnsubscribeAgent.g.cs | 69 +- ...lient.FeedsUpdateAllSubscriptionsCron.g.cs | 69 +- ...a.FeedsClient.FeedsUpdateSubscription.g.cs | 72 +- .../Letta/Generated/Letta.FeedsClient.g.cs | 8 +- .../Letta.FoldersClient.CountFolders.g.cs | 61 +- .../Letta.FoldersClient.CreateFolder.g.cs | 66 +- ...ta.FoldersClient.DeleteFileFromFolder.g.cs | 61 +- .../Letta.FoldersClient.DeleteFolder.g.cs | 62 +- ...tta.FoldersClient.ListAgentsForFolder.g.cs | 98 +- ...etta.FoldersClient.ListFilesForFolder.g.cs | 104 +- ...etta.FoldersClient.ListFolderPassages.g.cs | 98 +- .../Letta.FoldersClient.ListFolders.g.cs | 98 +- .../Letta.FoldersClient.ModifyFolder.g.cs | 71 +- .../Letta.FoldersClient.RetrieveFile.g.cs | 81 +- .../Letta.FoldersClient.RetrieveFolder.g.cs | 66 +- .../Letta.FoldersClient.RetrieveMetadata.g.cs | 75 +- ...etta.FoldersClient.UploadFileToFolder.g.cs | 1089 +++++++++++++- .../Letta/Generated/Letta.FoldersClient.g.cs | 8 +- .../Letta.HealthClient.CheckHealth.g.cs | 61 +- .../Letta.HealthClient.CheckReadiness.g.cs | 61 +- .../Letta/Generated/Letta.HealthClient.g.cs | 8 +- ...gentsClient.AgentsCountDeployedAgents.g.cs | 16 + ...IAgentsClient.AgentsGetAgentVariables.g.cs | 12 + ...entsClient.AgentsSearchDeployedAgents.g.cs | 13 + ...ta.IAgentsClient.AttachArchiveToAgent.g.cs | 16 + ...a.IAgentsClient.AttachCoreMemoryBlock.g.cs | 18 + ...tta.IAgentsClient.AttachFolderToAgent.g.cs | 18 + ...a.IAgentsClient.AttachIdentityToAgent.g.cs | 16 + ...Letta.IAgentsClient.AttachToolToAgent.g.cs | 18 + .../Letta.IAgentsClient.CancelMessage.g.cs | 18 + ...a.IAgentsClient.CloseAllFilesForAgent.g.cs | 16 + ...Letta.IAgentsClient.CloseFileForAgent.g.cs | 20 + .../Letta.IAgentsClient.CountAgents.g.cs | 56 + .../Letta.IAgentsClient.CreateAgent.g.cs | 17 + ...IAgentsClient.CreateAgentMessageAsync.g.cs | 22 + .../Letta.IAgentsClient.CreatePassage.g.cs | 17 + .../Letta.IAgentsClient.DeleteAgent.g.cs | 14 + .../Letta.IAgentsClient.DeletePassage.g.cs | 16 + ....IAgentsClient.DetachArchiveFromAgent.g.cs | 16 + ...a.IAgentsClient.DetachCoreMemoryBlock.g.cs | 18 + ...a.IAgentsClient.DetachFolderFromAgent.g.cs | 18 + ...IAgentsClient.DetachIdentityFromAgent.g.cs | 16 + ...tta.IAgentsClient.DetachToolFromAgent.g.cs | 18 + .../Letta.IAgentsClient.ExportAgent.g.cs | 33 + ...a.IAgentsClient.ExportAgentWithSkills.g.cs | 17 + ...etta.IAgentsClient.GenerateCompletion.g.cs | 32 + .../Letta.IAgentsClient.ImportAgent.g.cs | 107 ++ .../Letta.IAgentsClient.ListAgents.g.cs | 97 ++ ...ta.IAgentsClient.ListCoreMemoryBlocks.g.cs | 37 + ...Letta.IAgentsClient.ListFilesForAgent.g.cs | 45 + ...tta.IAgentsClient.ListFoldersForAgent.g.cs | 37 + ...etta.IAgentsClient.ListGroupsForAgent.g.cs | 41 + .../Letta.IAgentsClient.ListMessages.g.cs | 68 + .../Letta.IAgentsClient.ListPassages.g.cs | 36 + ...Letta.IAgentsClient.ListToolsForAgent.g.cs | 37 + .../Letta.IAgentsClient.ModifyAgent.g.cs | 17 + ...a.IAgentsClient.ModifyApprovalForTool.g.cs | 24 + ...a.IAgentsClient.ModifyCoreMemoryBlock.g.cs | 19 + .../Letta.IAgentsClient.OpenFileForAgent.g.cs | 21 + ...tta.IAgentsClient.PreviewModelRequest.g.cs | 20 + .../Letta.IAgentsClient.RecompileAgent.g.cs | 24 + .../Letta.IAgentsClient.ResetMessages.g.cs | 17 + .../Letta.IAgentsClient.RetrieveAgent.g.cs | 23 + ...IAgentsClient.RetrieveCoreMemoryBlock.g.cs | 16 + .../Letta.IAgentsClient.RunToolForAgent.g.cs | 21 + ...ta.IAgentsClient.SearchArchivalMemory.g.cs | 42 + .../Letta.IAgentsClient.SearchMessages.g.cs | 14 + .../Letta.IAgentsClient.SendMessage.g.cs | 28 + ...Letta.IAgentsClient.SummarizeMessages.g.cs | 17 + .../Letta.IArchivesClient.CreateArchive.g.cs | 13 + ...ArchivesClient.CreatePassageInArchive.g.cs | 18 + ...rchivesClient.CreatePassagesInArchive.g.cs | 18 + .../Letta.IArchivesClient.DeleteArchive.g.cs | 14 + ...chivesClient.DeletePassageFromArchive.g.cs | 19 + ....IArchivesClient.ListAgentsForArchive.g.cs | 37 + .../Letta.IArchivesClient.ListArchives.g.cs | 41 + .../Letta.IArchivesClient.ModifyArchive.g.cs | 17 + ...Letta.IArchivesClient.RetrieveArchive.g.cs | 14 + ...a.IBlocksClient.AttachIdentityToBlock.g.cs | 16 + .../Letta.IBlocksClient.CountBlocks.g.cs | 37 + .../Letta.IBlocksClient.CreateBlock.g.cs | 12 + .../Letta.IBlocksClient.DeleteBlock.g.cs | 13 + ...IBlocksClient.DetachIdentityFromBlock.g.cs | 16 + ...etta.IBlocksClient.ListAgentsForBlock.g.cs | 47 + .../Letta.IBlocksClient.ListBlocks.g.cs | 90 ++ .../Letta.IBlocksClient.ModifyBlock.g.cs | 16 + .../Letta.IBlocksClient.RetrieveBlock.g.cs | 13 + ...etta.IChatClient.CreateChatCompletion.g.cs | 17 + ...cessTokensCreateClientSideAccessToken.g.cs | 13 + ...cessTokensDeleteClientSideAccessToken.g.cs | 15 + ...ccessTokensListClientSideAccessTokens.g.cs | 20 + ...onversationsClient.CancelConversation.g.cs | 22 + ...nversationsClient.CompactConversation.g.cs | 22 + ...onversationsClient.CreateConversation.g.cs | 17 + ...onversationsClient.DeleteConversation.g.cs | 17 + ...IConversationsClient.ForkConversation.g.cs | 24 + ...ationsClient.ListConversationMessages.g.cs | 58 + ...ConversationsClient.ListConversations.g.cs | 37 + ...lient.PreviewConversationModelRequest.g.cs | 21 + ...ersationsClient.RecompileConversation.g.cs | 22 + ...versationsClient.RetrieveConversation.g.cs | 14 + ...ionsClient.RetrieveConversationStream.g.cs | 26 + ...sationsClient.SendConversationMessage.g.cs | 23 + ...onversationsClient.UpdateConversation.g.cs | 17 + ...ient.DeviceStorageGetDeviceStorageKey.g.cs | 12 + ...IEmbeddingsClient.GetTotalStorageSize.g.cs | 14 + ...sClient.EnvironmentsDeleteEnvironment.g.cs | 15 + ...mentsClient.EnvironmentsGetConnection.g.cs | 12 + ...ntsClient.EnvironmentsListConnections.g.cs | 18 + ...vironmentsClient.EnvironmentsRegister.g.cs | 13 + ...onmentsClient.EnvironmentsSendMessage.g.cs | 15 + ...FeedsClient.FeedsBackfillSubscription.g.cs | 17 + .../Letta.IFeedsClient.FeedsCreateFeed.g.cs | 13 + .../Letta.IFeedsClient.FeedsDeleteFeed.g.cs | 15 + ....IFeedsClient.FeedsDeleteSubscription.g.cs | 17 + .../Letta.IFeedsClient.FeedsGetFeed.g.cs | 12 + .../Letta.IFeedsClient.FeedsGetMessage.g.cs | 14 + .../Letta.IFeedsClient.FeedsListFeeds.g.cs | 18 + .../Letta.IFeedsClient.FeedsListMessages.g.cs | 16 + ...dsClient.FeedsListSubscriptionHistory.g.cs | 18 + ...a.IFeedsClient.FeedsListSubscriptions.g.cs | 18 + ...tta.IFeedsClient.FeedsPublishMessages.g.cs | 15 + ...etta.IFeedsClient.FeedsSubscribeAgent.g.cs | 15 + ...IFeedsClient.FeedsTriggerSubscription.g.cs | 17 + ...ta.IFeedsClient.FeedsUnsubscribeAgent.g.cs | 15 + ...lient.FeedsUpdateAllSubscriptionsCron.g.cs | 15 + ....IFeedsClient.FeedsUpdateSubscription.g.cs | 17 + .../Letta.IFoldersClient.CountFolders.g.cs | 10 + .../Letta.IFoldersClient.CreateFolder.g.cs | 13 + ...a.IFoldersClient.DeleteFileFromFolder.g.cs | 18 + .../Letta.IFoldersClient.DeleteFolder.g.cs | 14 + ...ta.IFoldersClient.ListAgentsForFolder.g.cs | 37 + ...tta.IFoldersClient.ListFilesForFolder.g.cs | 42 + ...tta.IFoldersClient.ListFolderPassages.g.cs | 37 + .../Letta.IFoldersClient.ListFolders.g.cs | 37 + .../Letta.IFoldersClient.ModifyFolder.g.cs | 17 + .../Letta.IFoldersClient.RetrieveFile.g.cs | 23 + .../Letta.IFoldersClient.RetrieveFolder.g.cs | 14 + ...Letta.IFoldersClient.RetrieveMetadata.g.cs | 19 + ...tta.IFoldersClient.UploadFileToFolder.g.cs | 85 ++ .../Letta.IHealthClient.CheckHealth.g.cs | 10 + .../Letta.IHealthClient.CheckReadiness.g.cs | 10 + ...ernalAgentsClient.CountInternalAgents.g.cs | 15 + ...sClient.ModifyInternalCoreMemoryBlock.g.cs | 19 + ...ernalBlocksClient.CreateInternalBlock.g.cs | 12 + ...ernalBlocksClient.DeleteInternalBlock.g.cs | 13 + ...ocksClient.ListAgentsForInternalBlock.g.cs | 47 + ...ternalBlocksClient.ListInternalBlocks.g.cs | 81 + ....IInternalRunsClient.ListInternalRuns.g.cs | 112 ++ ...tesClient.CreateInternalTemplateAgent.g.cs | 13 + ...tesClient.CreateInternalTemplateBlock.g.cs | 13 + ...ent.CreateInternalTemplateBlocksBatch.g.cs | 13 + ...tesClient.CreateInternalTemplateGroup.g.cs | 13 + ...ernalTemplatesClient.DeleteDeployment.g.cs | 13 + ...emplatesClient.ListDeploymentEntities.g.cs | 17 + .../Letta.IJobsClient.CancelJob.g.cs | 16 + .../Letta.IJobsClient.DeleteJob.g.cs | 14 + .../Generated/Letta.IJobsClient.ListJobs.g.cs | 47 + .../Letta.IJobsClient.RetrieveJob.g.cs | 14 + ...IMcpServersClient.McpConnectMcpServer.g.cs | 13 + ....IMcpServersClient.McpCreateMcpServer.g.cs | 13 + ....IMcpServersClient.McpDeleteMcpServer.g.cs | 12 + ...a.IMcpServersClient.McpListMcpServers.g.cs | 10 + ...erversClient.McpListToolsForMcpServer.g.cs | 12 + ...erversClient.McpRefreshMcpServerTools.g.cs | 19 + ...McpServersClient.McpRetrieveMcpServer.g.cs | 12 + ....IMcpServersClient.McpRetrieveMcpTool.g.cs | 14 + .../Letta.IMcpServersClient.McpRunTool.g.cs | 18 + ....IMcpServersClient.McpUpdateMcpServer.g.cs | 15 + ...FilesClient.MemoryFilesGetFileHistory.g.cs | 16 + ...yFilesClient.MemoryFilesListDirectory.g.cs | 18 + ...ilesClient.MemoryFilesReadFileContent.g.cs | 16 + .../Letta.IMessagesClient.CancelBatch.g.cs | 12 + .../Letta.IMessagesClient.CreateBatch.g.cs | 15 + ...Letta.IMessagesClient.ListAllMessages.g.cs | 36 + .../Letta.IMessagesClient.ListBatches.g.cs | 33 + ....IMessagesClient.ListMessagesForBatch.g.cs | 39 + .../Letta.IMessagesClient.RetrieveBatch.g.cs | 12 + ...Letta.IMessagesClient.RetrieveMessage.g.cs | 14 + ...tta.IMessagesClient.SearchAllMessages.g.cs | 15 + ...tta.IMetadataClient.MetadataGetStatus.g.cs | 9 + ...Letta.IMetadataClient.MetadataGetUser.g.cs | 10 + ...lient.MetadataRetrieveCurrentBalances.g.cs | 10 + ....IMetadataClient.MetadataSendFeedback.g.cs | 13 + ...IMetadataClient.MetadataSendTelemetry.g.cs | 13 + ...tta.IModelsClient.ListEmbeddingModels.g.cs | 12 + .../Letta.IModelsClient.ListModels.g.cs | 18 + ...odelsClient.ModelsListEmbeddingModels.g.cs | 9 + .../Letta.IPassagesClient.SearchPassages.g.cs | 19 + ...pelinesClient.PipelinesCountPipelines.g.cs | 16 + ...pelinesClient.PipelinesCreatePipeline.g.cs | 13 + ...pelinesClient.PipelinesDeletePipeline.g.cs | 15 + ...IPipelinesClient.PipelinesGetPipeline.g.cs | 12 + ...ient.PipelinesListPipelineSyncHistory.g.cs | 12 + ...ipelinesClient.PipelinesListPipelines.g.cs | 20 + ...elinesClient.PipelinesPreviewPipeline.g.cs | 13 + ...PipelinesClient.PipelinesSyncPipeline.g.cs | 15 + ...pelinesClient.PipelinesUpdatePipeline.g.cs | 15 + ...PipelinesUpdatePipelineProducerConfig.g.cs | 15 + ...IProjectsClient.ProjectsCreateProject.g.cs | 13 + ...IProjectsClient.ProjectsDeleteProject.g.cs | 15 + ....IProjectsClient.ProjectsListProjects.g.cs | 16 + ...ProvidersClient.CheckExistingProvider.g.cs | 14 + .../Letta.IProvidersClient.CheckProvider.g.cs | 13 + ...Letta.IProvidersClient.CreateProvider.g.cs | 13 + ...Letta.IProvidersClient.DeleteProvider.g.cs | 14 + .../Letta.IProvidersClient.ListProviders.g.cs | 41 + ...Letta.IProvidersClient.ModifyProvider.g.cs | 17 + ...ProvidersClient.RefreshProviderModels.g.cs | 15 + ...tta.IProvidersClient.RetrieveProvider.g.cs | 14 + .../Letta.IRunsClient.DeleteRun.g.cs | 12 + .../Letta.IRunsClient.ListMessagesForRun.g.cs | 35 + .../Generated/Letta.IRunsClient.ListRuns.g.cs | 67 + .../Letta.IRunsClient.ListStepsForRun.g.cs | 35 + ...tta.IRunsClient.RetrieveMetricsForRun.g.cs | 12 + .../Letta.IRunsClient.RetrieveRun.g.cs | 12 + ...etta.IRunsClient.RetrieveStreamForRun.g.cs | 14 + ...Letta.IRunsClient.RetrieveTraceForRun.g.cs | 23 + ...Letta.IRunsClient.RetrieveUsageForRun.g.cs | 12 + ...andboxesClient.SandboxesCreateSandbox.g.cs | 13 + ...andboxesClient.SandboxesListSandboxes.g.cs | 14 + ...boxesClient.SandboxesTerminateSandbox.g.cs | 15 + ...heduledMessagesDeleteScheduledMessage.g.cs | 17 + ...cheduledMessagesListScheduledMessages.g.cs | 16 + ...duledMessagesRetrieveScheduledMessage.g.cs | 14 + ...ScheduledMessagesScheduleAgentMessage.g.cs | 15 + ...etta.IStepsClient.ListMessagesForStep.g.cs | 37 + .../Letta.IStepsClient.ListSteps.g.cs | 73 + ...ta.IStepsClient.ModifyFeedbackForStep.g.cs | 17 + ...a.IStepsClient.RetrieveMetricsForStep.g.cs | 14 + .../Letta.IStepsClient.RetrieveStep.g.cs | 14 + ...tta.IStepsClient.RetrieveTraceForStep.g.cs | 13 + .../Generated/Letta.ITagClient.ListTags.g.cs | 41 + ...ent.TemplatesCreateAgentsFromTemplate.g.cs | 17 + ...atesCreateAgentsFromTemplateNoProject.g.cs | 15 + ...mplatesClient.TemplatesCreateTemplate.g.cs | 15 + ...ient.TemplatesCreateTemplateNoProject.g.cs | 13 + ...mplatesClient.TemplatesDeleteTemplate.g.cs | 17 + ...ient.TemplatesDeleteTemplateNoProject.g.cs | 15 + ...TemplatesClient.TemplatesForkTemplate.g.cs | 17 + ...esClient.TemplatesGetTemplateSnapshot.g.cs | 14 + ...platesClient.TemplatesLegacyMigration.g.cs | 15 + ...sClient.TemplatesListTemplateVersions.g.cs | 18 + ...emplatesClient.TemplatesListTemplates.g.cs | 30 + ...atesClient.TemplatesMigrateDeployment.g.cs | 19 + ...mplatesClient.TemplatesRenameTemplate.g.cs | 17 + ...latesClient.TemplatesRollbackTemplate.g.cs | 17 + ...nt.TemplatesRollbackTemplateNoProject.g.cs | 15 + ...esClient.TemplatesSaveTemplateVersion.g.cs | 17 + ...TemplatesSaveTemplateVersionNoProject.g.cs | 15 + ...mplatesSetCurrentTemplateFromSnapshot.g.cs | 17 + ...tesUpdateCurrentTemplateFromAgentFile.g.cs | 17 + ...CurrentTemplateFromAgentFileNoProject.g.cs | 15 + ...nt.TemplatesUpdateTemplateDescription.g.cs | 17 + .../Letta.IToolsClient.AddBaseTools.g.cs | 10 + .../Letta.IToolsClient.AddMcpServer.g.cs | 13 + .../Letta.IToolsClient.AddMcpTool.g.cs | 14 + .../Letta.IToolsClient.ConnectMcpServer.g.cs | 14 + .../Letta.IToolsClient.CountTools.g.cs | 42 + .../Letta.IToolsClient.CreateTool.g.cs | 13 + .../Letta.IToolsClient.DeleteMcpServer.g.cs | 12 + .../Letta.IToolsClient.DeleteTool.g.cs | 14 + .../Letta.IToolsClient.ExecuteMcpTool.g.cs | 18 + .../Letta.IToolsClient.ListMcpServers.g.cs | 10 + ...tta.IToolsClient.ListMcpToolsByServer.g.cs | 12 + .../Letta.IToolsClient.ListTools.g.cs | 62 + .../Letta.IToolsClient.McpOauthCallback.g.cs | 27 + .../Letta.IToolsClient.ModifyTool.g.cs | 17 + ...tta.IToolsClient.ResyncMcpServerTools.g.cs | 19 + .../Letta.IToolsClient.RetrieveTool.g.cs | 14 + .../Letta.IToolsClient.RunToolFromSource.g.cs | 13 + .../Letta.IToolsClient.SearchTools.g.cs | 16 + .../Letta.IToolsClient.TestMcpServer.g.cs | 14 + .../Letta.IToolsClient.UpdateMcpServer.g.cs | 15 + .../Letta.IToolsClient.UpsertTool.g.cs | 13 + ...ernalAgentsClient.CountInternalAgents.g.cs | 71 +- ...sClient.ModifyInternalCoreMemoryBlock.g.cs | 74 +- .../Generated/Letta.InternalAgentsClient.g.cs | 8 +- ...ernalBlocksClient.CreateInternalBlock.g.cs | 65 +- ...ernalBlocksClient.DeleteInternalBlock.g.cs | 61 +- ...ocksClient.ListAgentsForInternalBlock.g.cs | 110 +- ...ternalBlocksClient.ListInternalBlocks.g.cs | 153 +- .../Generated/Letta.InternalBlocksClient.g.cs | 8 +- ...a.InternalRunsClient.ListInternalRuns.g.cs | 191 ++- .../Generated/Letta.InternalRunsClient.g.cs | 8 +- ...tesClient.CreateInternalTemplateAgent.g.cs | 66 +- ...tesClient.CreateInternalTemplateBlock.g.cs | 66 +- ...ent.CreateInternalTemplateBlocksBatch.g.cs | 66 +- ...tesClient.CreateInternalTemplateGroup.g.cs | 66 +- ...ernalTemplatesClient.DeleteDeployment.g.cs | 65 +- ...emplatesClient.ListDeploymentEntities.g.cs | 74 +- .../Letta.InternalTemplatesClient.g.cs | 8 +- .../Generated/Letta.JobsClient.CancelJob.g.cs | 68 +- .../Generated/Letta.JobsClient.DeleteJob.g.cs | 66 +- .../Generated/Letta.JobsClient.ListJobs.g.cs | 110 +- .../Letta.JobsClient.RetrieveJob.g.cs | 66 +- .../Letta/Generated/Letta.JobsClient.g.cs | 8 +- .../Letta/Generated/Letta.LettaClient.g.cs | 74 +- ....McpServersClient.McpConnectMcpServer.g.cs | 61 +- ...a.McpServersClient.McpCreateMcpServer.g.cs | 66 +- ...a.McpServersClient.McpDeleteMcpServer.g.cs | 54 +- ...ta.McpServersClient.McpListMcpServers.g.cs | 61 +- ...erversClient.McpListToolsForMcpServer.g.cs | 64 +- ...erversClient.McpRefreshMcpServerTools.g.cs | 72 +- ...McpServersClient.McpRetrieveMcpServer.g.cs | 64 +- ...a.McpServersClient.McpRetrieveMcpTool.g.cs | 67 +- .../Letta.McpServersClient.McpRunTool.g.cs | 73 +- ...a.McpServersClient.McpUpdateMcpServer.g.cs | 69 +- .../Generated/Letta.McpServersClient.g.cs | 8 +- ...FilesClient.MemoryFilesGetFileHistory.g.cs | 74 +- ...yFilesClient.MemoryFilesListDirectory.g.cs | 77 +- ...ilesClient.MemoryFilesReadFileContent.g.cs | 74 +- .../Generated/Letta.MemoryFilesClient.g.cs | 8 +- .../Letta.MessagesClient.CancelBatch.g.cs | 60 +- .../Letta.MessagesClient.CreateBatch.g.cs | 68 +- .../Letta.MessagesClient.ListAllMessages.g.cs | 97 +- .../Letta.MessagesClient.ListBatches.g.cs | 93 +- ...a.MessagesClient.ListMessagesForBatch.g.cs | 101 +- .../Letta.MessagesClient.RetrieveBatch.g.cs | 64 +- .../Letta.MessagesClient.RetrieveMessage.g.cs | 66 +- ...etta.MessagesClient.SearchAllMessages.g.cs | 68 +- .../Letta/Generated/Letta.MessagesClient.g.cs | 8 +- ...etta.MetadataClient.MetadataGetStatus.g.cs | 60 +- .../Letta.MetadataClient.MetadataGetUser.g.cs | 61 +- ...lient.MetadataRetrieveCurrentBalances.g.cs | 61 +- ...a.MetadataClient.MetadataSendFeedback.g.cs | 66 +- ....MetadataClient.MetadataSendTelemetry.g.cs | 66 +- .../Letta/Generated/Letta.MetadataClient.g.cs | 8 +- ...etta.ModelsClient.ListEmbeddingModels.g.cs | 63 +- .../Letta.ModelsClient.ListModels.g.cs | 76 +- ...odelsClient.ModelsListEmbeddingModels.g.cs | 50 +- .../Letta/Generated/Letta.ModelsClient.g.cs | 8 +- .../Letta/Generated/Letta.OptionsSupport.g.cs | 231 ++- .../Letta.PassagesClient.SearchPassages.g.cs | 72 +- .../Letta/Generated/Letta.PassagesClient.g.cs | 8 +- ...pelinesClient.PipelinesCountPipelines.g.cs | 74 +- ...pelinesClient.PipelinesCreatePipeline.g.cs | 66 +- ...pelinesClient.PipelinesDeletePipeline.g.cs | 69 +- ....PipelinesClient.PipelinesGetPipeline.g.cs | 64 +- ...ient.PipelinesListPipelineSyncHistory.g.cs | 64 +- ...ipelinesClient.PipelinesListPipelines.g.cs | 80 +- ...elinesClient.PipelinesPreviewPipeline.g.cs | 66 +- ...PipelinesClient.PipelinesSyncPipeline.g.cs | 69 +- ...pelinesClient.PipelinesUpdatePipeline.g.cs | 69 +- ...PipelinesUpdatePipelineProducerConfig.g.cs | 69 +- .../Generated/Letta.PipelinesClient.g.cs | 8 +- ....ProjectsClient.ProjectsCreateProject.g.cs | 66 +- ....ProjectsClient.ProjectsDeleteProject.g.cs | 69 +- ...a.ProjectsClient.ProjectsListProjects.g.cs | 74 +- .../Letta/Generated/Letta.ProjectsClient.g.cs | 8 +- ...ProvidersClient.CheckExistingProvider.g.cs | 62 +- .../Letta.ProvidersClient.CheckProvider.g.cs | 62 +- .../Letta.ProvidersClient.CreateProvider.g.cs | 66 +- .../Letta.ProvidersClient.DeleteProvider.g.cs | 62 +- .../Letta.ProvidersClient.ListProviders.g.cs | 103 +- .../Letta.ProvidersClient.ModifyProvider.g.cs | 71 +- ...ProvidersClient.RefreshProviderModels.g.cs | 67 +- ...etta.ProvidersClient.RetrieveProvider.g.cs | 66 +- .../Generated/Letta.ProvidersClient.g.cs | 8 +- .../Generated/Letta.RunsClient.DeleteRun.g.cs | 60 +- .../Letta.RunsClient.ListMessagesForRun.g.cs | 96 +- .../Generated/Letta.RunsClient.ListRuns.g.cs | 135 +- .../Letta.RunsClient.ListStepsForRun.g.cs | 96 +- ...etta.RunsClient.RetrieveMetricsForRun.g.cs | 64 +- .../Letta.RunsClient.RetrieveRun.g.cs | 64 +- ...Letta.RunsClient.RetrieveStreamForRun.g.cs | 64 +- .../Letta.RunsClient.RetrieveTraceForRun.g.cs | 80 +- .../Letta.RunsClient.RetrieveUsageForRun.g.cs | 64 +- .../Letta/Generated/Letta.RunsClient.g.cs | 8 +- ...andboxesClient.SandboxesCreateSandbox.g.cs | 66 +- ...andboxesClient.SandboxesListSandboxes.g.cs | 71 +- ...boxesClient.SandboxesTerminateSandbox.g.cs | 69 +- .../Generated/Letta.SandboxesClient.g.cs | 8 +- ...heduledMessagesDeleteScheduledMessage.g.cs | 72 +- ...cheduledMessagesListScheduledMessages.g.cs | 74 +- ...duledMessagesRetrieveScheduledMessage.g.cs | 67 +- ...ScheduledMessagesScheduleAgentMessage.g.cs | 69 +- .../Letta.ScheduledMessagesClient.g.cs | 8 +- ...Letta.StepsClient.ListMessagesForStep.g.cs | 98 +- .../Letta.StepsClient.ListSteps.g.cs | 143 +- ...tta.StepsClient.ModifyFeedbackForStep.g.cs | 71 +- ...ta.StepsClient.RetrieveMetricsForStep.g.cs | 66 +- .../Letta.StepsClient.RetrieveStep.g.cs | 66 +- ...etta.StepsClient.RetrieveTraceForStep.g.cs | 65 +- .../Letta/Generated/Letta.StepsClient.g.cs | 8 +- .../Generated/Letta.TagClient.ListTags.g.cs | 103 +- src/libs/Letta/Generated/Letta.TagClient.g.cs | 8 +- ...ent.TemplatesCreateAgentsFromTemplate.g.cs | 62 +- ...atesCreateAgentsFromTemplateNoProject.g.cs | 69 +- ...mplatesClient.TemplatesCreateTemplate.g.cs | 69 +- ...ient.TemplatesCreateTemplateNoProject.g.cs | 66 +- ...mplatesClient.TemplatesDeleteTemplate.g.cs | 72 +- ...ient.TemplatesDeleteTemplateNoProject.g.cs | 69 +- ...TemplatesClient.TemplatesForkTemplate.g.cs | 72 +- ...esClient.TemplatesGetTemplateSnapshot.g.cs | 67 +- ...platesClient.TemplatesLegacyMigration.g.cs | 69 +- ...sClient.TemplatesListTemplateVersions.g.cs | 77 +- ...emplatesClient.TemplatesListTemplates.g.cs | 95 +- ...atesClient.TemplatesMigrateDeployment.g.cs | 75 +- ...mplatesClient.TemplatesRenameTemplate.g.cs | 72 +- ...latesClient.TemplatesRollbackTemplate.g.cs | 72 +- ...nt.TemplatesRollbackTemplateNoProject.g.cs | 69 +- ...esClient.TemplatesSaveTemplateVersion.g.cs | 72 +- ...TemplatesSaveTemplateVersionNoProject.g.cs | 69 +- ...mplatesSetCurrentTemplateFromSnapshot.g.cs | 72 +- ...tesUpdateCurrentTemplateFromAgentFile.g.cs | 72 +- ...CurrentTemplateFromAgentFileNoProject.g.cs | 69 +- ...nt.TemplatesUpdateTemplateDescription.g.cs | 72 +- .../Generated/Letta.TemplatesClient.g.cs | 8 +- .../Letta.ToolsClient.AddBaseTools.g.cs | 61 +- .../Letta.ToolsClient.AddMcpServer.g.cs | 66 +- .../Letta.ToolsClient.AddMcpTool.g.cs | 67 +- .../Letta.ToolsClient.ConnectMcpServer.g.cs | 63 +- .../Letta.ToolsClient.CountTools.g.cs | 105 +- .../Letta.ToolsClient.CreateTool.g.cs | 66 +- .../Letta.ToolsClient.DeleteMcpServer.g.cs | 64 +- .../Letta.ToolsClient.DeleteTool.g.cs | 62 +- .../Letta.ToolsClient.ExecuteMcpTool.g.cs | 69 +- .../Letta.ToolsClient.ListMcpServers.g.cs | 57 +- ...etta.ToolsClient.ListMcpToolsByServer.g.cs | 64 +- .../Letta.ToolsClient.ListTools.g.cs | 129 +- .../Letta.ToolsClient.McpOauthCallback.g.cs | 82 +- .../Letta.ToolsClient.ModifyTool.g.cs | 71 +- ...etta.ToolsClient.ResyncMcpServerTools.g.cs | 72 +- .../Letta.ToolsClient.RetrieveTool.g.cs | 66 +- .../Letta.ToolsClient.RunToolFromSource.g.cs | 66 +- .../Letta.ToolsClient.SearchTools.g.cs | 69 +- .../Letta.ToolsClient.TestMcpServer.g.cs | 63 +- .../Letta.ToolsClient.UpdateMcpServer.g.cs | 69 +- .../Letta.ToolsClient.UpsertTool.g.cs | 66 +- .../Letta/Generated/Letta.ToolsClient.g.cs | 8 +- 544 files changed, 25241 insertions(+), 2272 deletions(-) create mode 100644 src/libs/Letta/Generated/Letta.AutoSDKHttpResponse.g.cs diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs index 1aec37aa..65d51443 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsCountDeployedAgents.g.cs @@ -74,6 +74,33 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( global::Letta.AgentsCountDeployedAgentsCombinator? combinator = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsCountDeployedAgentsAsResponseAsync( + search: search, + projectId: projectId, + combinator: combinator, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Deployed Agents
+ /// Count deployed agents matching search criteria + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsCountDeployedAgentsAsResponseAsync( + global::System.Collections.Generic.IList>? search = default, + string? projectId = default, + global::Letta.AgentsCountDeployedAgentsCombinator? combinator = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,15 +132,16 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/search/count", baseUri: ResolveBaseUri( servers: s_AgentsCountDeployedAgentsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("search", search, selector: static x => x.ToString() ?? string.Empty, delimiter: ",", explode: true) .AddOptionalParameter("project_id", projectId) - .AddOptionalParameter("combinator", combinator?.ToValueString()) + .AddOptionalParameter("combinator", combinator?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -187,6 +215,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +227,11 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +249,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +260,7 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +269,11 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +290,15 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +338,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +360,8 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -340,9 +386,13 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentsCountDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentsCountDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -370,9 +420,13 @@ partial void ProcessAgentsCountDeployedAgentsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentsCountDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentsCountDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs index 10d91424..13bde044 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsGetAgentVariables.g.cs @@ -66,6 +66,27 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsGetAgentVariablesAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Memory Variables
+ /// Get the variables associated with an agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsGetAgentVariablesAsResponseAsync( + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/core-memory/variables", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -361,9 +401,13 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentsGetAgentVariablesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentsGetAgentVariablesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessAgentsGetAgentVariablesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentsGetAgentVariablesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentsGetAgentVariablesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs index 809e1625..1d558515 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AgentsSearchDeployedAgents.g.cs @@ -64,6 +64,29 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( /// public async global::System.Threading.Tasks.Task AgentsSearchDeployedAgentsAsync( + global::Letta.AgentsSearchDeployedAgentsRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsSearchDeployedAgentsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search Deployed Agents
+ /// Search deployed agents + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsSearchDeployedAgentsAsResponseAsync( + global::Letta.AgentsSearchDeployedAgentsRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/search", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentsSearchDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentsSearchDeployedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessAgentsSearchDeployedAgentsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentsSearchDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentsSearchDeployedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs index 4715402a..27a11246 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachArchiveToAgent.g.cs @@ -72,6 +72,32 @@ partial void ProcessAttachArchiveToAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachArchiveToAgentAsResponseAsync( + archiveId: archiveId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach Archive To Agent
+ /// Attach an archive to an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachArchiveToAgentAsResponseAsync( + string archiveId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessAttachArchiveToAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/archives/attach/{archiveId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessAttachArchiveToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessAttachArchiveToAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessAttachArchiveToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessAttachArchiveToAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessAttachArchiveToAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessAttachArchiveToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessAttachArchiveToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessAttachArchiveToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +414,11 @@ partial void ProcessAttachArchiveToAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +446,11 @@ partial void ProcessAttachArchiveToAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs index 2999cc1c..ac319b1c 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachCoreMemoryBlock.g.cs @@ -74,6 +74,34 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachCoreMemoryBlockAsResponseAsync( + blockId: blockId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach Block To Agent
+ /// Attach a core memory block to an agent. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachCoreMemoryBlockAsResponseAsync( + string blockId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +132,7 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/core-memory/blocks/attach/{blockId}", baseUri: ResolveBaseUri( @@ -180,6 +209,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessAttachCoreMemoryBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs index 7b3a5ebc..0ea153f9 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachFolderToAgent.g.cs @@ -74,6 +74,34 @@ partial void ProcessAttachFolderToAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachFolderToAgentAsResponseAsync( + folderId: folderId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach Folder To Agent
+ /// Attach a folder to an agent. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachFolderToAgentAsResponseAsync( + string folderId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +132,7 @@ partial void ProcessAttachFolderToAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/folders/attach/{folderId}", baseUri: ResolveBaseUri( @@ -180,6 +209,8 @@ partial void ProcessAttachFolderToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessAttachFolderToAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessAttachFolderToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessAttachFolderToAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessAttachFolderToAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessAttachFolderToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessAttachFolderToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessAttachFolderToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessAttachFolderToAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessAttachFolderToAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs index 40f3098a..74909dd9 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachIdentityToAgent.g.cs @@ -72,6 +72,32 @@ partial void ProcessAttachIdentityToAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachIdentityToAgentAsResponseAsync( + identityId: identityId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach Identity To Agent
+ /// Attach an identity to an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachIdentityToAgentAsResponseAsync( + string identityId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessAttachIdentityToAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/identities/attach/{identityId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessAttachIdentityToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessAttachIdentityToAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessAttachIdentityToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessAttachIdentityToAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessAttachIdentityToAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessAttachIdentityToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessAttachIdentityToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessAttachIdentityToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +414,11 @@ partial void ProcessAttachIdentityToAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +446,11 @@ partial void ProcessAttachIdentityToAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs index a8a848ae..a8778d35 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.AttachToolToAgent.g.cs @@ -74,6 +74,34 @@ partial void ProcessAttachToolToAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachToolToAgentAsResponseAsync( + toolId: toolId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach Tool To Agent
+ /// Attach a tool to an agent. + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachToolToAgentAsResponseAsync( + string toolId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +132,7 @@ partial void ProcessAttachToolToAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/tools/attach/{toolId}", baseUri: ResolveBaseUri( @@ -180,6 +209,8 @@ partial void ProcessAttachToolToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessAttachToolToAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessAttachToolToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessAttachToolToAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessAttachToolToAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessAttachToolToAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessAttachToolToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessAttachToolToAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessAttachToolToAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessAttachToolToAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs index 733e6763..17b94597 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CancelMessage.g.cs @@ -71,6 +71,35 @@ partial void ProcessCancelMessageResponseContent( public async global::System.Threading.Tasks.Task CancelMessageAsync( string agentId, + global::Letta.CancelAgentRunRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelMessageAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel Message
+ /// Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
+ /// Note to cancel active runs associated with an agent, redis is required. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CancelMessageAsResponseAsync( + string agentId, + global::Letta.CancelAgentRunRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -106,6 +135,7 @@ partial void ProcessCancelMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/messages/cancel", baseUri: ResolveBaseUri( @@ -188,6 +218,8 @@ partial void ProcessCancelMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +230,11 @@ partial void ProcessCancelMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +252,8 @@ partial void ProcessCancelMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +263,7 @@ partial void ProcessCancelMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +272,11 @@ partial void ProcessCancelMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +293,15 @@ partial void ProcessCancelMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +341,8 @@ partial void ProcessCancelMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +363,8 @@ partial void ProcessCancelMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,7 +427,11 @@ partial void ProcessCancelMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -407,7 +459,11 @@ partial void ProcessCancelMessageResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs index d8086a06..10e4991a 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CloseAllFilesForAgent.g.cs @@ -70,6 +70,31 @@ partial void ProcessCloseAllFilesForAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CloseAllFilesForAgentAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Close All Files For Agent
+ /// Closes all currently open files for a given agent.
+ /// This endpoint updates the file state for the agent so that no files are marked as open.
+ /// Typically used to reset the working memory view for the agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> CloseAllFilesForAgentAsResponseAsync( + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -99,6 +124,7 @@ partial void ProcessCloseAllFilesForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/files/close-all", baseUri: ResolveBaseUri( @@ -174,6 +200,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +212,11 @@ partial void ProcessCloseAllFilesForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -201,6 +234,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +245,7 @@ partial void ProcessCloseAllFilesForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +254,11 @@ partial void ProcessCloseAllFilesForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -236,14 +275,15 @@ partial void ProcessCloseAllFilesForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -283,6 +323,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +345,8 @@ partial void ProcessCloseAllFilesForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -365,9 +409,13 @@ partial void ProcessCloseAllFilesForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -395,9 +443,13 @@ partial void ProcessCloseAllFilesForAgentResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs index fb5712c8..450fd93b 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CloseFileForAgent.g.cs @@ -76,6 +76,36 @@ partial void ProcessCloseFileForAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CloseFileForAgentAsResponseAsync( + fileId: fileId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Close File For Agent
+ /// Closes a specific file for a given agent.
+ /// This endpoint marks a specific file as closed in the agent's file state.
+ /// The file will be removed from the agent's working memory view. + ///
+ /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CloseFileForAgentAsResponseAsync( + string fileId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -106,6 +136,7 @@ partial void ProcessCloseFileForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/files/{fileId}/close", baseUri: ResolveBaseUri( @@ -182,6 +213,8 @@ partial void ProcessCloseFileForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +225,11 @@ partial void ProcessCloseFileForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +247,8 @@ partial void ProcessCloseFileForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +258,7 @@ partial void ProcessCloseFileForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +267,11 @@ partial void ProcessCloseFileForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +288,15 @@ partial void ProcessCloseFileForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +336,8 @@ partial void ProcessCloseFileForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +358,8 @@ partial void ProcessCloseFileForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -373,7 +422,11 @@ partial void ProcessCloseFileForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -401,7 +454,11 @@ partial void ProcessCloseFileForAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs index fa8d751f..340ce2bf 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CountAgents.g.cs @@ -130,6 +130,81 @@ partial void ProcessCountAgentsResponseContent( string? createdById = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CountAgentsAsResponseAsync( + name: name, + tags: tags, + matchAllTags: matchAllTags, + queryText: queryText, + projectId: projectId, + templateId: templateId, + baseTemplateId: baseTemplateId, + identityId: identityId, + identifierKeys: identifierKeys, + lastStopReason: lastStopReason, + createdById: createdById, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Agents
+ /// Get the total number of agents with optional filtering.
+ /// Supports the same filters as list_agents for consistent querying. + ///
+ /// + /// Name of the agent + /// + /// + /// List of tags to filter agents by + /// + /// + /// If True, only counts agents that match ALL given tags. Otherwise, counts agents that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Search agents by name + /// + /// + /// Search agents by project ID - this will default to your default project on cloud + /// + /// + /// Search agents by template ID + /// + /// + /// Search agents by base template ID + /// + /// + /// Search agents by identity ID + /// + /// + /// Search agents by identifier keys + /// + /// + /// Filter agents by their last stop reason. + /// + /// + /// Filter agents by the user who created them. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CountAgentsAsResponseAsync( + string? name = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + string? queryText = default, + string? projectId = default, + string? templateId = default, + string? baseTemplateId = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + global::Letta.StopReasonType? lastStopReason = default, + string? createdById = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -169,11 +244,12 @@ partial void ProcessCountAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/count", baseUri: ResolveBaseUri( servers: s_CountAgentsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("name", name) .AddOptionalParameter("tags", tags?.ToString()) @@ -185,7 +261,7 @@ partial void ProcessCountAgentsResponseContent( .AddOptionalParameter("identity_id", identityId) .AddOptionalParameter("identifier_keys", identifierKeys?.ToString()) .AddOptionalParameter("last_stop_reason", lastStopReason?.ToString()) - .AddOptionalParameter("created_by_id", createdById) + .AddOptionalParameter("created_by_id", createdById) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -267,6 +343,8 @@ partial void ProcessCountAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -277,6 +355,11 @@ partial void ProcessCountAgentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -294,6 +377,8 @@ partial void ProcessCountAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -303,8 +388,7 @@ partial void ProcessCountAgentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -313,6 +397,11 @@ partial void ProcessCountAgentsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -329,14 +418,15 @@ partial void ProcessCountAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -376,6 +466,8 @@ partial void ProcessCountAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -396,6 +488,8 @@ partial void ProcessCountAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -458,9 +552,13 @@ partial void ProcessCountAgentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? + var __value = (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -488,9 +586,13 @@ partial void ProcessCountAgentsResponseContent( #endif ).ConfigureAwait(false); - return - (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs index 270f30c2..4335db1d 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgent.g.cs @@ -71,6 +71,34 @@ partial void ProcessCreateAgentResponseContent( /// public async global::System.Threading.Tasks.Task CreateAgentAsync( + global::Letta.CreateAgentRequest request, + string? xProject = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentAsResponseAsync( + + request: request, + xProject: xProject, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Agent
+ /// Create an agent. + ///
+ /// + /// The project slug to associate with the agent (cloud only). + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentAsResponseAsync( + global::Letta.CreateAgentRequest request, string? xProject = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, @@ -107,6 +135,7 @@ partial void ProcessCreateAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/", baseUri: ResolveBaseUri( @@ -195,6 +224,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +236,11 @@ partial void ProcessCreateAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +258,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +269,7 @@ partial void ProcessCreateAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +278,11 @@ partial void ProcessCreateAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +299,15 @@ partial void ProcessCreateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +347,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +369,8 @@ partial void ProcessCreateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +433,13 @@ partial void ProcessCreateAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +467,13 @@ partial void ProcessCreateAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs index 3cbf44e0..65483ad0 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CreateAgentMessageAsync.g.cs @@ -77,6 +77,39 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( public async global::System.Threading.Tasks.Task CreateAgentMessageAsyncAsync( string agentId, + global::Letta.LettaAsyncRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateAgentMessageAsyncAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Send Message Async
+ /// Asynchronously process a user message and return a run object.
+ /// The actual processing happens in the background, and the status can be checked using the run ID.
+ /// This is "asynchronous" in the sense that it's a background run and explicitly must be fetched by the run ID.
+ /// **Note:** Sending multiple concurrent requests to the same agent can lead to undefined behavior.
+ /// Each agent processes messages sequentially, and concurrent requests may interleave in unexpected ways.
+ /// Wait for each request to complete before sending the next one. Use separate agents or conversations for parallel processing. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateAgentMessageAsyncAsResponseAsync( + string agentId, + global::Letta.LettaAsyncRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +145,7 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/messages/async", baseUri: ResolveBaseUri( @@ -194,6 +228,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +240,11 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +262,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +273,7 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +282,11 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +303,15 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +351,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +373,8 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -385,9 +437,13 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Run.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Run.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -415,9 +471,13 @@ partial void ProcessCreateAgentMessageAsyncResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs index 0a577254..3e4ea606 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.CreatePassage.g.cs @@ -70,6 +70,34 @@ partial void ProcessCreatePassageResponseContent( public async global::System.Threading.Tasks.Task> CreatePassageAsync( string agentId, + global::Letta.CreateArchivalMemory request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreatePassageAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Passage
+ /// Insert a memory into an agent's archival memory store. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> CreatePassageAsResponseAsync( + string agentId, + global::Letta.CreateArchivalMemory request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessCreatePassageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/archival-memory", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessCreatePassageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessCreatePassageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessCreatePassageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessCreatePassageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessCreatePassageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessCreatePassageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessCreatePassageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessCreatePassageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessCreatePassageResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessCreatePassageResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs index 1ca700fd..ab05511c 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DeleteAgent.g.cs @@ -68,6 +68,29 @@ partial void ProcessDeleteAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAgentAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Agent
+ /// Delete an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteAgentAsResponseAsync( + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessDeleteAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessDeleteAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessDeleteAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessDeleteAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessDeleteAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,7 +405,11 @@ partial void ProcessDeleteAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -391,7 +437,11 @@ partial void ProcessDeleteAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs index 41856376..156bf9cd 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DeletePassage.g.cs @@ -72,6 +72,32 @@ partial void ProcessDeletePassageResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeletePassageAsResponseAsync( + memoryId: memoryId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Passage
+ /// Delete a memory from an agent's archival memory store. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeletePassageAsResponseAsync( + string memoryId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessDeletePassageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/archival-memory/{memoryId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessDeletePassageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessDeletePassageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessDeletePassageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessDeletePassageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessDeletePassageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessDeletePassageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessDeletePassageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessDeletePassageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +414,11 @@ partial void ProcessDeletePassageResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +446,11 @@ partial void ProcessDeletePassageResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs index 4a3ffa3a..48eb4aae 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachArchiveFromAgent.g.cs @@ -72,6 +72,32 @@ partial void ProcessDetachArchiveFromAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachArchiveFromAgentAsResponseAsync( + archiveId: archiveId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach Archive From Agent
+ /// Detach an archive from an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachArchiveFromAgentAsResponseAsync( + string archiveId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessDetachArchiveFromAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/archives/detach/{archiveId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessDetachArchiveFromAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessDetachArchiveFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessDetachArchiveFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +414,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +446,11 @@ partial void ProcessDetachArchiveFromAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs index 0356e681..b5603d7d 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachCoreMemoryBlock.g.cs @@ -74,6 +74,34 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachCoreMemoryBlockAsResponseAsync( + blockId: blockId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach Block From Agent
+ /// Detach a core memory block from an agent. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachCoreMemoryBlockAsResponseAsync( + string blockId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +132,7 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/core-memory/blocks/detach/{blockId}", baseUri: ResolveBaseUri( @@ -180,6 +209,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessDetachCoreMemoryBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs index 1b8a7adc..0fffba7d 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachFolderFromAgent.g.cs @@ -74,6 +74,34 @@ partial void ProcessDetachFolderFromAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachFolderFromAgentAsResponseAsync( + folderId: folderId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach Folder From Agent
+ /// Detach a folder from an agent. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachFolderFromAgentAsResponseAsync( + string folderId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +132,7 @@ partial void ProcessDetachFolderFromAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/folders/detach/{folderId}", baseUri: ResolveBaseUri( @@ -180,6 +209,8 @@ partial void ProcessDetachFolderFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessDetachFolderFromAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessDetachFolderFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessDetachFolderFromAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessDetachFolderFromAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessDetachFolderFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessDetachFolderFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessDetachFolderFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessDetachFolderFromAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessDetachFolderFromAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs index d4e7de5a..8a628f30 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachIdentityFromAgent.g.cs @@ -72,6 +72,32 @@ partial void ProcessDetachIdentityFromAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachIdentityFromAgentAsResponseAsync( + identityId: identityId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach Identity From Agent
+ /// Detach an identity from an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachIdentityFromAgentAsResponseAsync( + string identityId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessDetachIdentityFromAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/identities/detach/{identityId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessDetachIdentityFromAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessDetachIdentityFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessDetachIdentityFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +414,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +446,11 @@ partial void ProcessDetachIdentityFromAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs index c05877ba..5745f2fc 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.DetachToolFromAgent.g.cs @@ -74,6 +74,34 @@ partial void ProcessDetachToolFromAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachToolFromAgentAsResponseAsync( + toolId: toolId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach Tool From Agent
+ /// Detach a tool from an agent. + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachToolFromAgentAsResponseAsync( + string toolId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -104,6 +132,7 @@ partial void ProcessDetachToolFromAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/tools/detach/{toolId}", baseUri: ResolveBaseUri( @@ -180,6 +209,8 @@ partial void ProcessDetachToolFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessDetachToolFromAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessDetachToolFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessDetachToolFromAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessDetachToolFromAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessDetachToolFromAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessDetachToolFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessDetachToolFromAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessDetachToolFromAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessDetachToolFromAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs index ed86a782..86b008eb 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgent.g.cs @@ -92,6 +92,54 @@ partial void ProcessExportAgentResponseContent( public async global::System.Threading.Tasks.Task ExportAgentAsync( string agentId, + global::Letta.BodyExportAgent request, + int? maxSteps = default, + bool? useLegacyFormat = default, + string? conversationId = default, + bool? scrubMessages = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExportAgentAsResponseAsync( + agentId: agentId, + + request: request, + maxSteps: maxSteps, + useLegacyFormat: useLegacyFormat, + conversationId: conversationId, + scrubMessages: scrubMessages, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Export Agent
+ /// Export the serialized JSON representation of an agent, formatted with indentation. + ///
+ /// + /// + /// Default Value: 100 + /// + /// + /// If True, exports using the legacy single-agent 'v1' format with inline tools/blocks. If False, exports using the new multi-entity 'v2' format, with separate agents, tools, blocks, files, etc.
+ /// Default Value: false + /// + /// + /// Conversation ID to export. If provided, uses messages from this conversation instead of the agent's global message history. + /// + /// + /// If True, excludes all messages from the export. Useful for sharing agent configs without conversation history.
+ /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ExportAgentAsResponseAsync( + string agentId, + global::Letta.BodyExportAgent request, int? maxSteps = default, bool? useLegacyFormat = default, @@ -135,16 +183,17 @@ partial void ProcessExportAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/export", baseUri: ResolveBaseUri( servers: s_ExportAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("max_steps", maxSteps?.ToString()) .AddOptionalParameter("use_legacy_format", useLegacyFormat?.ToString().ToLowerInvariant()) .AddOptionalParameter("conversation_id", conversationId) - .AddOptionalParameter("scrub_messages", scrubMessages?.ToString().ToLowerInvariant()) + .AddOptionalParameter("scrub_messages", scrubMessages?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -227,6 +276,8 @@ partial void ProcessExportAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -237,6 +288,11 @@ partial void ProcessExportAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -254,6 +310,8 @@ partial void ProcessExportAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -263,8 +321,7 @@ partial void ProcessExportAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +330,11 @@ partial void ProcessExportAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -289,14 +351,15 @@ partial void ProcessExportAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +399,8 @@ partial void ProcessExportAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -356,6 +421,8 @@ partial void ProcessExportAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -418,7 +485,11 @@ partial void ProcessExportAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -446,7 +517,11 @@ partial void ProcessExportAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs index e8cfb0d0..e6a48ccf 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ExportAgentWithSkills.g.cs @@ -70,6 +70,34 @@ partial void ProcessExportAgentWithSkillsResponseContent( public async global::System.Threading.Tasks.Task ExportAgentWithSkillsAsync( string agentId, + global::Letta.ExportAgentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExportAgentWithSkillsAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Export Agent With Skills
+ /// Export the serialized JSON representation of an agent with optional skills.
+ /// This POST endpoint allows including skills in the export by providing them in the request body.
+ /// Skills are resolved client-side and passed as SkillSchema objects containing the skill files. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ExportAgentWithSkillsAsResponseAsync( + string agentId, + global::Letta.ExportAgentRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessExportAgentWithSkillsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/export", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessExportAgentWithSkillsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessExportAgentWithSkillsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessExportAgentWithSkillsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessExportAgentWithSkillsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessExportAgentWithSkillsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessExportAgentWithSkillsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessExportAgentWithSkillsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessExportAgentWithSkillsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,7 +425,11 @@ partial void ProcessExportAgentWithSkillsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -406,7 +457,11 @@ partial void ProcessExportAgentWithSkillsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs index 3bb6b8d9..e81fe514 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.GenerateCompletion.g.cs @@ -85,6 +85,49 @@ partial void ProcessGenerateCompletionResponseContent( public async global::System.Threading.Tasks.Task GenerateCompletionAsync( string agentId, + global::Letta.GenerateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GenerateCompletionAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Generate Completion
+ /// Generate a completion directly from the LLM provider using the agent's configuration.
+ /// This endpoint makes a direct request to the LLM provider without any agent processing:
+ /// - No memory or context retrieval
+ /// - No tool calling
+ /// - No message persistence
+ /// - No agent state modification
+ /// Simply provide a prompt, and the endpoint formats it as a user message.
+ /// Optionally include a system_prompt for context/instructions.
+ /// The agent's LLM configuration (model, credentials, settings) is used by default.
+ /// Use override_model to switch to a different model/provider while still using
+ /// the organization's configured providers.
+ /// Example use cases:
+ /// - Quick LLM queries without agent overhead
+ /// - Testing different models with the same prompt
+ /// - Simple chat completions using agent's credentials
+ /// - Comparing model outputs on identical prompts + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GenerateCompletionAsResponseAsync( + string agentId, + global::Letta.GenerateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -120,6 +163,7 @@ partial void ProcessGenerateCompletionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/generate", baseUri: ResolveBaseUri( @@ -202,6 +246,8 @@ partial void ProcessGenerateCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -212,6 +258,11 @@ partial void ProcessGenerateCompletionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -229,6 +280,8 @@ partial void ProcessGenerateCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -238,8 +291,7 @@ partial void ProcessGenerateCompletionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -248,6 +300,11 @@ partial void ProcessGenerateCompletionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -264,14 +321,15 @@ partial void ProcessGenerateCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -311,6 +369,8 @@ partial void ProcessGenerateCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -331,6 +391,8 @@ partial void ProcessGenerateCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // @@ -454,9 +516,13 @@ partial void ProcessGenerateCompletionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.GenerateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.GenerateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -484,9 +550,13 @@ partial void ProcessGenerateCompletionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.GenerateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.GenerateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs index 2a64b21a..fd0efca5 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ImportAgent.g.cs @@ -70,6 +70,33 @@ partial void ProcessImportAgentResponseContent( /// public async global::System.Threading.Tasks.Task ImportAgentAsync( + global::Letta.BodyImportAgent request, + string? xOverrideEmbeddingModel = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ImportAgentAsResponseAsync( + + request: request, + xOverrideEmbeddingModel: xOverrideEmbeddingModel, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImportAgentAsResponseAsync( + global::Letta.BodyImportAgent request, string? xOverrideEmbeddingModel = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, @@ -102,10 +129,11 @@ partial void ProcessImportAgentResponseContent( var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/import", baseUri: ResolveBaseUri( @@ -146,6 +174,7 @@ partial void ProcessImportAgentResponseContent( __httpRequest.Headers.TryAddWithoutValidation("x-override-embedding-model", xOverrideEmbeddingModel.ToString()); } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); if (xOverrideEmbeddingModel != default) { @@ -153,6 +182,7 @@ partial void ProcessImportAgentResponseContent( __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(xOverrideEmbeddingModel ?? string.Empty), name: "\"x-override-embedding-model\""); + } var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -191,91 +221,106 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + if (request.OverrideExistingTools != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.OverrideExistingTools, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"override_existing_tools\""); - } + + } if (request.StripMessages != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StripMessages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"strip_messages\""); - } + + } if (request.Secrets != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Secrets ?? string.Empty), name: "\"secrets\""); - } + + } if (request.Name != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), name: "\"name\""); - } + + } if (request.Embedding != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Embedding ?? string.Empty), name: "\"embedding\""); - } + + } if (request.Model != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), name: "\"model\""); - } + + } if (request.AppendCopySuffix != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AppendCopySuffix, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), name: "\"append_copy_suffix\""); - } + + } if (request.OverrideName != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.OverrideName ?? string.Empty), name: "\"override_name\""); - } + + } if (request.OverrideEmbeddingHandle != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.OverrideEmbeddingHandle ?? string.Empty), name: "\"override_embedding_handle\""); - } + + } if (request.OverrideModelHandle != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.OverrideModelHandle ?? string.Empty), name: "\"override_model_handle\""); - } + + } if (request.ProjectId != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.ProjectId ?? string.Empty), name: "\"project_id\""); - } + + } if (request.EnvVarsJson != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(request.EnvVarsJson ?? string.Empty), name: "\"env_vars_json\""); + } + __httpRequest.Content = __httpRequestContent; + global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -318,6 +363,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -328,6 +375,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -345,6 +397,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -354,8 +408,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -364,6 +417,11 @@ request.Filename is null __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -380,14 +438,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -427,6 +486,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -447,6 +508,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -509,9 +572,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -539,9 +606,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -641,5 +712,1208 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents. + ///
+ /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.
+ /// Default Value: true + /// + /// + /// If set to True, strips all messages from the agent before importing.
+ /// Default Value: false + /// + /// + /// Secrets as a JSON string to pass to the agent for tool execution. + /// + /// + /// If provided, overrides the agent name with this value. + /// + /// + /// Embedding handle to override with. + /// + /// + /// Model handle to override the agent's default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ImportAgentAsync( + global::System.IO.Stream file, + string filename, + string? xOverrideEmbeddingModel = default, + bool? overrideExistingTools = default, + bool? stripMessages = default, + string? secrets = default, + string? name = default, + string? embedding = default, + string? model = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Letta.BodyImportAgent + { + File = global::System.Array.Empty(), + Filename = filename, + OverrideExistingTools = overrideExistingTools, + StripMessages = stripMessages, + Secrets = secrets, + Name = name, + Embedding = embedding, + Model = model, + }; + PrepareArguments( + client: HttpClient); + PrepareImportAgentArguments( + httpClient: HttpClient, + xOverrideEmbeddingModel: ref xOverrideEmbeddingModel, + request: request); + + + var __authorizations = global::Letta.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImportAgentSecurityRequirements, + operationName: "ImportAgentAsync"); + + using var __timeoutCancellationTokenSource = global::Letta.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Letta.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Letta.PathBuilder( + path: "/v1/agents/import", + baseUri: ResolveBaseUri( + servers: s_ImportAgentServers, + defaultBaseUrl: "https://app.letta.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xOverrideEmbeddingModel != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-override-embedding-model", xOverrideEmbeddingModel.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xOverrideEmbeddingModel != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xOverrideEmbeddingModel ?? string.Empty), + name: "\"x-override-embedding-model\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.OverrideExistingTools != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.OverrideExistingTools, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"override_existing_tools\""); + + } + if (request.StripMessages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StripMessages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"strip_messages\""); + + } + if (request.Secrets != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Secrets ?? string.Empty), + name: "\"secrets\""); + + } + if (request.Name != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + } + if (request.Embedding != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Embedding ?? string.Empty), + name: "\"embedding\""); + + } + if (request.Model != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + } + if (request.AppendCopySuffix != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AppendCopySuffix, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"append_copy_suffix\""); + + } + if (request.OverrideName != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OverrideName ?? string.Empty), + name: "\"override_name\""); + + } + if (request.OverrideEmbeddingHandle != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OverrideEmbeddingHandle ?? string.Empty), + name: "\"override_embedding_handle\""); + + } + if (request.OverrideModelHandle != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OverrideModelHandle ?? string.Empty), + name: "\"override_model_handle\""); + + } + if (request.ProjectId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ProjectId ?? string.Empty), + name: "\"project_id\""); + + } + if (request.EnvVarsJson != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.EnvVarsJson ?? string.Empty), + name: "\"env_vars_json\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImportAgentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xOverrideEmbeddingModel: xOverrideEmbeddingModel, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Letta.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImportAgentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Letta.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Letta.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImportAgentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents. + ///
+ /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.
+ /// Default Value: true + /// + /// + /// If set to True, strips all messages from the agent before importing.
+ /// Default Value: false + /// + /// + /// Secrets as a JSON string to pass to the agent for tool execution. + /// + /// + /// If provided, overrides the agent name with this value. + /// + /// + /// Embedding handle to override with. + /// + /// + /// Model handle to override the agent's default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ImportAgentAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? xOverrideEmbeddingModel = default, + bool? overrideExistingTools = default, + bool? stripMessages = default, + string? secrets = default, + string? name = default, + string? embedding = default, + string? model = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Letta.BodyImportAgent + { + File = global::System.Array.Empty(), + Filename = filename, + OverrideExistingTools = overrideExistingTools, + StripMessages = stripMessages, + Secrets = secrets, + Name = name, + Embedding = embedding, + Model = model, + }; + PrepareArguments( + client: HttpClient); + PrepareImportAgentArguments( + httpClient: HttpClient, + xOverrideEmbeddingModel: ref xOverrideEmbeddingModel, + request: request); + + + var __authorizations = global::Letta.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ImportAgentSecurityRequirements, + operationName: "ImportAgentAsync"); + + using var __timeoutCancellationTokenSource = global::Letta.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Letta.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Letta.PathBuilder( + path: "/v1/agents/import", + baseUri: ResolveBaseUri( + servers: s_ImportAgentServers, + defaultBaseUrl: "https://app.letta.com/")); + var __path = __pathBuilder.ToString(); + __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xOverrideEmbeddingModel != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-override-embedding-model", xOverrideEmbeddingModel.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + if (xOverrideEmbeddingModel != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xOverrideEmbeddingModel ?? string.Empty), + name: "\"x-override-embedding-model\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.OverrideExistingTools != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.OverrideExistingTools, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"override_existing_tools\""); + + } + if (request.StripMessages != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.StripMessages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"strip_messages\""); + + } + if (request.Secrets != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Secrets ?? string.Empty), + name: "\"secrets\""); + + } + if (request.Name != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + } + if (request.Embedding != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Embedding ?? string.Empty), + name: "\"embedding\""); + + } + if (request.Model != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + } + if (request.AppendCopySuffix != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.AppendCopySuffix, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()), + name: "\"append_copy_suffix\""); + + } + if (request.OverrideName != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OverrideName ?? string.Empty), + name: "\"override_name\""); + + } + if (request.OverrideEmbeddingHandle != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OverrideEmbeddingHandle ?? string.Empty), + name: "\"override_embedding_handle\""); + + } + if (request.OverrideModelHandle != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.OverrideModelHandle ?? string.Empty), + name: "\"override_model_handle\""); + + } + if (request.ProjectId != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ProjectId ?? string.Empty), + name: "\"project_id\""); + + } + if (request.EnvVarsJson != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.EnvVarsJson ?? string.Empty), + name: "\"env_vars_json\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareImportAgentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xOverrideEmbeddingModel: xOverrideEmbeddingModel, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Letta.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessImportAgentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ImportAgent", + methodName: "ImportAgentAsync", + pathTemplate: "\"/v1/agents/import\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Letta.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Letta.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessImportAgentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Letta.ImportedAgentsResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Letta.ImportedAgentsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs index a1a14526..5dee6a87 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListAgents.g.cs @@ -191,6 +191,131 @@ partial void ProcessListAgentsResponseContent( string? createdById = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsAsResponseAsync( + name: name, + tags: tags, + matchAllTags: matchAllTags, + before: before, + after: after, + limit: limit, + queryText: queryText, + projectId: projectId, + templateId: templateId, + baseTemplateId: baseTemplateId, + identityId: identityId, + identifierKeys: identifierKeys, + includeRelationships: includeRelationships, + include: include, + order: order, + orderBy: orderBy, + ascending: ascending, + sortBy: sortBy, + lastStopReason: lastStopReason, + createdById: createdById, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents
+ /// Get a list of all agents. + ///
+ /// + /// Name of the agent + /// + /// + /// List of tags to filter agents by + /// + /// + /// If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Cursor for pagination + /// + /// + /// Cursor for pagination + /// + /// + /// Limit for pagination
+ /// Default Value: 50 + /// + /// + /// Search agents by name + /// + /// + /// Search agents by project ID - this will default to your default project on cloud + /// + /// + /// Search agents by template ID + /// + /// + /// Search agents by base template ID + /// + /// + /// Search agents by identity ID + /// + /// + /// Search agents by identifier keys + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default)
+ /// Default Value: false + /// + /// + /// Field to sort by. Options: 'created_at' (default), 'last_run_completion'
+ /// Default Value: created_at + /// + /// + /// Filter agents by their last stop reason. + /// + /// + /// Filter agents by the user who created them. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsAsResponseAsync( + string? name = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + string? before = default, + string? after = default, + int? limit = default, + string? queryText = default, + string? projectId = default, + string? templateId = default, + string? baseTemplateId = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.ListAgentsOrder? order = default, + global::Letta.ListAgentsOrderBy? orderBy = default, + bool? ascending = default, + string? sortBy = default, + global::Letta.StopReasonType? lastStopReason = default, + string? createdById = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -239,11 +364,12 @@ partial void ProcessListAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/", baseUri: ResolveBaseUri( servers: s_ListAgentsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("name", name) .AddOptionalParameter("tags", tags?.ToString()) @@ -264,7 +390,7 @@ partial void ProcessListAgentsResponseContent( .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) .AddOptionalParameter("sort_by", sortBy) .AddOptionalParameter("last_stop_reason", lastStopReason?.ToString()) - .AddOptionalParameter("created_by_id", createdById) + .AddOptionalParameter("created_by_id", createdById) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -355,6 +481,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -365,6 +493,11 @@ partial void ProcessListAgentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -382,6 +515,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -391,8 +526,7 @@ partial void ProcessListAgentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -401,6 +535,11 @@ partial void ProcessListAgentsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -417,14 +556,15 @@ partial void ProcessListAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -464,6 +604,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -484,6 +626,8 @@ partial void ProcessListAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -546,9 +690,13 @@ partial void ProcessListAgentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -576,9 +724,13 @@ partial void ProcessListAgentsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs index 3c137f94..3d114a2b 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListCoreMemoryBlocks.g.cs @@ -101,6 +101,57 @@ partial void ProcessListCoreMemoryBlocksResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListCoreMemoryBlocksAsResponseAsync( + agentId: agentId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Blocks For Agent
+ /// Retrieve the core memory blocks of a specific agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order + /// + /// + /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order + /// + /// + /// Maximum number of blocks to return
+ /// Default Value: 100 + /// + /// + /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListCoreMemoryBlocksAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListCoreMemoryBlocksOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListCoreMemoryBlocksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/core-memory/blocks", baseUri: ResolveBaseUri( servers: s_ListCoreMemoryBlocksServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListCoreMemoryBlocksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListCoreMemoryBlocksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListCoreMemoryBlocksResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListCoreMemoryBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListCoreMemoryBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListCoreMemoryBlocksResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListCoreMemoryBlocksResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs index a47dab0d..8f6a1b13 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListFilesForAgent.g.cs @@ -115,6 +115,67 @@ partial void ProcessListFilesForAgentResponseContent( bool? isOpen = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFilesForAgentAsResponseAsync( + agentId: agentId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + cursor: cursor, + isOpen: isOpen, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Files For Agent
+ /// Get the files attached to an agent with their open/closed status. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// File ID cursor for pagination. Returns files that come before this file ID in the specified sort order + /// + /// + /// File ID cursor for pagination. Returns files that come after this file ID in the specified sort order + /// + /// + /// Maximum number of files to return
+ /// Default Value: 100 + /// + /// + /// Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Pagination cursor from previous response (deprecated, use before/after) + /// + /// + /// Filter by open status (true for open files, false for closed files) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListFilesForAgentAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFilesForAgentOrder? order = default, + string? orderBy = default, + string? cursor = default, + bool? isOpen = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -151,11 +212,12 @@ partial void ProcessListFilesForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/files", baseUri: ResolveBaseUri( servers: s_ListFilesForAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -163,7 +225,7 @@ partial void ProcessListFilesForAgentResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("cursor", cursor) - .AddOptionalParameter("is_open", isOpen?.ToString().ToLowerInvariant()) + .AddOptionalParameter("is_open", isOpen?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -242,6 +304,8 @@ partial void ProcessListFilesForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -252,6 +316,11 @@ partial void ProcessListFilesForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -269,6 +338,8 @@ partial void ProcessListFilesForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -278,8 +349,7 @@ partial void ProcessListFilesForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +358,11 @@ partial void ProcessListFilesForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -304,14 +379,15 @@ partial void ProcessListFilesForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -351,6 +427,8 @@ partial void ProcessListFilesForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -371,6 +449,8 @@ partial void ProcessListFilesForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -433,9 +513,13 @@ partial void ProcessListFilesForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PaginatedAgentFiles.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PaginatedAgentFiles.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -463,9 +547,13 @@ partial void ProcessListFilesForAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PaginatedAgentFiles.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PaginatedAgentFiles.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs index 56f1555a..c4860555 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListFoldersForAgent.g.cs @@ -101,6 +101,57 @@ partial void ProcessListFoldersForAgentResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFoldersForAgentAsResponseAsync( + agentId: agentId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Folders For Agent
+ /// Get the folders associated with an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order + /// + /// + /// Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order + /// + /// + /// Maximum number of sources to return
+ /// Default Value: 100 + /// + /// + /// Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListFoldersForAgentAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFoldersForAgentOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListFoldersForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/folders", baseUri: ResolveBaseUri( servers: s_ListFoldersForAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListFoldersForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListFoldersForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListFoldersForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListFoldersForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListFoldersForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListFoldersForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListFoldersForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListFoldersForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListFoldersForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListFoldersForAgentResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs index 5e532911..f35e99bf 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListGroupsForAgent.g.cs @@ -107,6 +107,62 @@ partial void ProcessListGroupsForAgentResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListGroupsForAgentAsResponseAsync( + agentId: agentId, + managerType: managerType, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Groups For Agent
+ /// Lists the groups for an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Manager type to filter groups by + /// + /// + /// Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order + /// + /// + /// Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order + /// + /// + /// Maximum number of groups to return
+ /// Default Value: 100 + /// + /// + /// Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListGroupsForAgentAsResponseAsync( + string agentId, + string? managerType = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListGroupsForAgentOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -142,18 +198,19 @@ partial void ProcessListGroupsForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/groups", baseUri: ResolveBaseUri( servers: s_ListGroupsForAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("manager_type", managerType) .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -231,6 +288,8 @@ partial void ProcessListGroupsForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -241,6 +300,11 @@ partial void ProcessListGroupsForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -258,6 +322,8 @@ partial void ProcessListGroupsForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -267,8 +333,7 @@ partial void ProcessListGroupsForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -277,6 +342,11 @@ partial void ProcessListGroupsForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -293,14 +363,15 @@ partial void ProcessListGroupsForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -340,6 +411,8 @@ partial void ProcessListGroupsForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -360,6 +433,8 @@ partial void ProcessListGroupsForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -422,9 +497,13 @@ partial void ProcessListGroupsForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -452,9 +531,13 @@ partial void ProcessListGroupsForAgentResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs index edd83f30..3fb2aa80 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListMessages.g.cs @@ -148,6 +148,95 @@ partial void ProcessListMessagesResponseContent( global::System.Collections.Generic.IList? includeReturnMessageTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMessagesAsResponseAsync( + agentId: agentId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + groupId: groupId, + conversationId: conversationId, + useAssistantMessage: useAssistantMessage, + assistantMessageToolName: assistantMessageToolName, + assistantMessageToolKwarg: assistantMessageToolKwarg, + includeErr: includeErr, + includeReturnMessageTypes: includeReturnMessageTypes, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Messages
+ /// Retrieve message history for an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Group ID to filter messages by. + /// + /// + /// Conversation ID to filter messages by. + /// + /// + /// Whether to use assistant messages
+ /// Default Value: true + /// + /// + /// The name of the designated message tool.
+ /// Default Value: send_message + /// + /// + /// The name of the message argument.
+ /// Default Value: message + /// + /// + /// Whether to include error messages and error statuses. For debugging purposes only. + /// + /// + /// Message types to include in response. When null, all message types are returned. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListMessagesAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesOrder? order = default, + string? orderBy = default, + string? groupId = default, + string? conversationId = default, + bool? useAssistantMessage = default, + string? assistantMessageToolName = default, + string? assistantMessageToolKwarg = default, + bool? includeErr = default, + global::System.Collections.Generic.IList? includeReturnMessageTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -189,11 +278,12 @@ partial void ProcessListMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/messages", baseUri: ResolveBaseUri( servers: s_ListMessagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -206,7 +296,7 @@ partial void ProcessListMessagesResponseContent( .AddOptionalParameter("assistant_message_tool_name", assistantMessageToolName) .AddOptionalParameter("assistant_message_tool_kwarg", assistantMessageToolKwarg) .AddOptionalParameter("include_err", includeErr?.ToString().ToLowerInvariant()) - .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString()) + .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -290,6 +380,8 @@ partial void ProcessListMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -300,6 +392,11 @@ partial void ProcessListMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -317,6 +414,8 @@ partial void ProcessListMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -326,8 +425,7 @@ partial void ProcessListMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +434,11 @@ partial void ProcessListMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -352,14 +455,15 @@ partial void ProcessListMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -399,6 +503,8 @@ partial void ProcessListMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -419,6 +525,8 @@ partial void ProcessListMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -481,9 +589,13 @@ partial void ProcessListMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +623,13 @@ partial void ProcessListMessagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs index 87883982..f0b6d700 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListPassages.g.cs @@ -100,6 +100,56 @@ partial void ProcessListPassagesResponseContent( bool? ascending = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListPassagesAsResponseAsync( + agentId: agentId, + after: after, + before: before, + limit: limit, + search: search, + ascending: ascending, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Passages
+ /// Retrieve the memories in an agent's archival memory store (paginated query). + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Unique ID of the memory to start the query range at. + /// + /// + /// Unique ID of the memory to end the query range at. + /// + /// + /// How many results to include in the response.
+ /// Default Value: 100 + /// + /// + /// Search passages by text + /// + /// + /// Whether to sort passages oldest to newest (True, default) or newest to oldest (False)
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListPassagesAsResponseAsync( + string agentId, + string? after = default, + string? before = default, + int? limit = default, + string? search = default, + bool? ascending = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -134,17 +184,18 @@ partial void ProcessListPassagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/archival-memory", baseUri: ResolveBaseUri( servers: s_ListPassagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("after", after) .AddOptionalParameter("before", before) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("search", search) - .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) + .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -221,6 +272,8 @@ partial void ProcessListPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -231,6 +284,11 @@ partial void ProcessListPassagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -248,6 +306,8 @@ partial void ProcessListPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -257,8 +317,7 @@ partial void ProcessListPassagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -267,6 +326,11 @@ partial void ProcessListPassagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -283,14 +347,15 @@ partial void ProcessListPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -330,6 +395,8 @@ partial void ProcessListPassagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -350,6 +417,8 @@ partial void ProcessListPassagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -412,9 +481,13 @@ partial void ProcessListPassagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -442,9 +515,13 @@ partial void ProcessListPassagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs index 2374ee8c..aea6ae3a 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ListToolsForAgent.g.cs @@ -101,6 +101,57 @@ partial void ProcessListToolsForAgentResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListToolsForAgentAsResponseAsync( + agentId: agentId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Tools For Agent
+ /// Get tools from an existing agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order + /// + /// + /// Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order + /// + /// + /// Maximum number of tools to return
+ /// Default Value: 10 + /// + /// + /// Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListToolsForAgentAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListToolsForAgentOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListToolsForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/tools", baseUri: ResolveBaseUri( servers: s_ListToolsForAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListToolsForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListToolsForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListToolsForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListToolsForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListToolsForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListToolsForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListToolsForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListToolsForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListToolsForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListToolsForAgentResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs index 17222dc8..71d8445d 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyAgent.g.cs @@ -72,6 +72,34 @@ partial void ProcessModifyAgentResponseContent( public async global::System.Threading.Tasks.Task ModifyAgentAsync( string agentId, + global::Letta.UpdateAgent request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyAgentAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Agent
+ /// Update an existing agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyAgentAsResponseAsync( + string agentId, + global::Letta.UpdateAgent request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -107,6 +135,7 @@ partial void ProcessModifyAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}", baseUri: ResolveBaseUri( @@ -189,6 +218,8 @@ partial void ProcessModifyAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -199,6 +230,11 @@ partial void ProcessModifyAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -216,6 +252,8 @@ partial void ProcessModifyAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -225,8 +263,7 @@ partial void ProcessModifyAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -235,6 +272,11 @@ partial void ProcessModifyAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -251,14 +293,15 @@ partial void ProcessModifyAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -298,6 +341,8 @@ partial void ProcessModifyAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -318,6 +363,8 @@ partial void ProcessModifyAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -380,9 +427,13 @@ partial void ProcessModifyAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -410,9 +461,13 @@ partial void ProcessModifyAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs index 500579f0..fbcb1682 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyApprovalForTool.g.cs @@ -82,6 +82,43 @@ partial void ProcessModifyApprovalForToolResponseContent( string toolName, string agentId, + global::Letta.ModifyApprovalRequest request, + bool? requiresApproval = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyApprovalForToolAsResponseAsync( + toolName: toolName, + agentId: agentId, + + request: request, + requiresApproval: requiresApproval, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Approval For Tool
+ /// Modify the approval requirement for a tool attached to an agent.
+ /// Accepts requires_approval via request body (preferred) or query parameter (deprecated). + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Whether the tool requires approval before execution + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyApprovalForToolAsResponseAsync( + string toolName, + string agentId, + global::Letta.ModifyApprovalRequest request, bool? requiresApproval = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, @@ -120,13 +157,14 @@ partial void ProcessModifyApprovalForToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/tools/approval/{toolName}", baseUri: ResolveBaseUri( servers: s_ModifyApprovalForToolServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("requires_approval", requiresApproval?.ToString().ToLowerInvariant()) + .AddOptionalParameter("requires_approval", requiresApproval?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -207,6 +245,8 @@ partial void ProcessModifyApprovalForToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -217,6 +257,11 @@ partial void ProcessModifyApprovalForToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -234,6 +279,8 @@ partial void ProcessModifyApprovalForToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -243,8 +290,7 @@ partial void ProcessModifyApprovalForToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -253,6 +299,11 @@ partial void ProcessModifyApprovalForToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -269,14 +320,15 @@ partial void ProcessModifyApprovalForToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -316,6 +368,8 @@ partial void ProcessModifyApprovalForToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -336,6 +390,8 @@ partial void ProcessModifyApprovalForToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -398,9 +454,13 @@ partial void ProcessModifyApprovalForToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -428,9 +488,13 @@ partial void ProcessModifyApprovalForToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs index 99555aa9..389845fe 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ModifyCoreMemoryBlock.g.cs @@ -74,6 +74,37 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( string blockLabel, string agentId, + global::Letta.BlockUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyCoreMemoryBlockAsResponseAsync( + blockLabel: blockLabel, + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Block For Agent
+ /// Updates a core memory block of an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyCoreMemoryBlockAsResponseAsync( + string blockLabel, + string agentId, + global::Letta.BlockUpdate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -110,6 +141,7 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/core-memory/blocks/{blockLabel}", baseUri: ResolveBaseUri( @@ -193,6 +225,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +237,11 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +259,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +270,7 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +279,11 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +300,15 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +348,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +370,8 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +434,13 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +468,13 @@ partial void ProcessModifyCoreMemoryBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs index 5d9e8f0a..ec1a513c 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.OpenFileForAgent.g.cs @@ -77,6 +77,37 @@ partial void ProcessOpenFileForAgentResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenFileForAgentAsResponseAsync( + fileId: fileId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Open File For Agent
+ /// Opens a specific file for a given agent.
+ /// This endpoint marks a specific file as open in the agent's file state.
+ /// The file will be included in the agent's working memory view.
+ /// Returns a list of file names that were closed due to LRU eviction. + ///
+ /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> OpenFileForAgentAsResponseAsync( + string fileId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -107,6 +138,7 @@ partial void ProcessOpenFileForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/files/{fileId}/open", baseUri: ResolveBaseUri( @@ -183,6 +215,8 @@ partial void ProcessOpenFileForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -193,6 +227,11 @@ partial void ProcessOpenFileForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -210,6 +249,8 @@ partial void ProcessOpenFileForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -219,8 +260,7 @@ partial void ProcessOpenFileForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -229,6 +269,11 @@ partial void ProcessOpenFileForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -245,14 +290,15 @@ partial void ProcessOpenFileForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -292,6 +338,8 @@ partial void ProcessOpenFileForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -312,6 +360,8 @@ partial void ProcessOpenFileForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -374,9 +424,13 @@ partial void ProcessOpenFileForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,9 +458,13 @@ partial void ProcessOpenFileForAgentResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs index f9217148..42b13eb0 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.PreviewModelRequest.g.cs @@ -73,6 +73,37 @@ partial void ProcessPreviewModelRequestResponseContent( public async global::System.Threading.Tasks.Task PreviewModelRequestAsync( string agentId, + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PreviewModelRequestAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Preview Model Request
+ /// Inspect the raw LLM request payload without sending it.
+ /// This endpoint processes the message through the agent loop up until
+ /// the LLM request, then returns the raw request payload that would
+ /// be sent to the LLM provider. Useful for debugging and inspection. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PreviewModelRequestAsResponseAsync( + string agentId, + global::Letta.AnyOf request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -106,6 +137,7 @@ partial void ProcessPreviewModelRequestResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/messages/preview-raw-payload", baseUri: ResolveBaseUri( @@ -188,6 +220,8 @@ partial void ProcessPreviewModelRequestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +232,11 @@ partial void ProcessPreviewModelRequestResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +254,8 @@ partial void ProcessPreviewModelRequestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +265,7 @@ partial void ProcessPreviewModelRequestResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +274,11 @@ partial void ProcessPreviewModelRequestResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +295,15 @@ partial void ProcessPreviewModelRequestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +343,8 @@ partial void ProcessPreviewModelRequestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +365,8 @@ partial void ProcessPreviewModelRequestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,7 +429,11 @@ partial void ProcessPreviewModelRequestResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -407,7 +461,11 @@ partial void ProcessPreviewModelRequestResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs index aec348b6..90c95be2 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.RecompileAgent.g.cs @@ -82,6 +82,41 @@ partial void ProcessRecompileAgentResponseContent( bool? dryRun = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RecompileAgentAsResponseAsync( + agentId: agentId, + updateTimestamp: updateTimestamp, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Recompile Agent
+ /// Manually trigger system prompt recompilation for an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// If True, update the in-context memory last edit timestamp embedded in the system prompt.
+ /// Default Value: false + /// + /// + /// If True, do not persist changes; still returns the compiled system prompt.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RecompileAgentAsResponseAsync( + string agentId, + bool? updateTimestamp = default, + bool? dryRun = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -113,14 +148,15 @@ partial void ProcessRecompileAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/recompile", baseUri: ResolveBaseUri( servers: s_RecompileAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("update_timestamp", updateTimestamp?.ToString().ToLowerInvariant()) - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -194,6 +230,8 @@ partial void ProcessRecompileAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +242,11 @@ partial void ProcessRecompileAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +264,8 @@ partial void ProcessRecompileAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +275,7 @@ partial void ProcessRecompileAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +284,11 @@ partial void ProcessRecompileAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +305,15 @@ partial void ProcessRecompileAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +353,8 @@ partial void ProcessRecompileAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +375,8 @@ partial void ProcessRecompileAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -385,7 +439,11 @@ partial void ProcessRecompileAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -413,7 +471,11 @@ partial void ProcessRecompileAgentResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs index a61027af..474f423b 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.ResetMessages.g.cs @@ -70,6 +70,34 @@ partial void ProcessResetMessagesResponseContent( public async global::System.Threading.Tasks.Task ResetMessagesAsync( string agentId, + global::Letta.ResetMessagesRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ResetMessagesAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Reset Messages
+ /// Resets the messages for an agent + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ResetMessagesAsResponseAsync( + string agentId, + global::Letta.ResetMessagesRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessResetMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/reset-messages", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessResetMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessResetMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessResetMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessResetMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessResetMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessResetMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessResetMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessResetMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessResetMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessResetMessagesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs index 07bfbe7b..2b25e187 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveAgent.g.cs @@ -83,6 +83,40 @@ partial void ProcessRetrieveAgentResponseContent( global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveAgentAsResponseAsync( + agentId: agentId, + includeRelationships: includeRelationships, + include: include, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Agent
+ /// Get the state of the agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveAgentAsResponseAsync( + string agentId, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -114,14 +148,15 @@ partial void ProcessRetrieveAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}", baseUri: ResolveBaseUri( servers: s_RetrieveAgentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("include_relationships", includeRelationships?.ToString()) - .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -195,6 +230,8 @@ partial void ProcessRetrieveAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +242,11 @@ partial void ProcessRetrieveAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +264,8 @@ partial void ProcessRetrieveAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +275,7 @@ partial void ProcessRetrieveAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +284,11 @@ partial void ProcessRetrieveAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +305,15 @@ partial void ProcessRetrieveAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +353,8 @@ partial void ProcessRetrieveAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +375,8 @@ partial void ProcessRetrieveAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +439,13 @@ partial void ProcessRetrieveAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +473,13 @@ partial void ProcessRetrieveAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs index cc3c69fb..94473c01 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.RetrieveCoreMemoryBlock.g.cs @@ -72,6 +72,32 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveCoreMemoryBlockAsResponseAsync( + blockLabel: blockLabel, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Block For Agent
+ /// Retrieve a core memory block from an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveCoreMemoryBlockAsResponseAsync( + string blockLabel, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/core-memory/blocks/{blockLabel}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +414,13 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -399,9 +448,13 @@ partial void ProcessRetrieveCoreMemoryBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs index d8735fd1..e9bdd829 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.RunToolForAgent.g.cs @@ -76,6 +76,39 @@ partial void ProcessRunToolForAgentResponseContent( string agentId, string toolName, + global::Letta.LettaSchemasMcpServerToolExecuteRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunToolForAgentAsResponseAsync( + agentId: agentId, + toolName: toolName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Tool For Agent
+ /// Trigger a tool by name on a specific agent, providing the necessary arguments.
+ /// This endpoint executes a tool that is attached to the agent, using the agent's
+ /// state and environment variables for execution context. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RunToolForAgentAsResponseAsync( + string agentId, + string toolName, + global::Letta.LettaSchemasMcpServerToolExecuteRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -112,6 +145,7 @@ partial void ProcessRunToolForAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/tools/{toolName}/run", baseUri: ResolveBaseUri( @@ -195,6 +229,8 @@ partial void ProcessRunToolForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +241,11 @@ partial void ProcessRunToolForAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +263,8 @@ partial void ProcessRunToolForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +274,7 @@ partial void ProcessRunToolForAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +283,11 @@ partial void ProcessRunToolForAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +304,15 @@ partial void ProcessRunToolForAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +352,8 @@ partial void ProcessRunToolForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +374,8 @@ partial void ProcessRunToolForAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +438,13 @@ partial void ProcessRunToolForAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ToolExecutionResult.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ToolExecutionResult.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +472,13 @@ partial void ProcessRunToolForAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ToolExecutionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ToolExecutionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs index ebcaeb29..c99af759 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.SearchArchivalMemory.g.cs @@ -108,6 +108,63 @@ partial void ProcessSearchArchivalMemoryResponseContent( global::System.DateTime? endDatetime = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchArchivalMemoryAsResponseAsync( + agentId: agentId, + query: query, + tags: tags, + tagMatchMode: tagMatchMode, + topK: topK, + startDatetime: startDatetime, + endDatetime: endDatetime, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search Archival Memory
+ /// Search archival memory using semantic (embedding-based) search with optional temporal filtering.
+ /// This endpoint allows manual triggering of archival memory searches, enabling users to query
+ /// an agent's archival memory store directly via the API. The search uses the same functionality
+ /// as the agent's archival_memory_search tool but is accessible for external API usage. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// String to search for using semantic similarity + /// + /// + /// Optional list of tags to filter search results + /// + /// + /// How to match tags - 'any' to match passages with any of the tags, 'all' to match only passages with all tags
+ /// Default Value: any + /// + /// + /// Maximum number of results to return. Uses system default if not specified + /// + /// + /// Filter results to passages created after this datetime + /// + /// + /// Filter results to passages created before this datetime + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SearchArchivalMemoryAsResponseAsync( + string agentId, + string query, + global::System.Collections.Generic.IList? tags = default, + global::Letta.SearchArchivalMemoryTagMatchMode? tagMatchMode = default, + int? topK = default, + global::System.DateTime? startDatetime = default, + global::System.DateTime? endDatetime = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -143,18 +200,19 @@ partial void ProcessSearchArchivalMemoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/archival-memory/search", baseUri: ResolveBaseUri( servers: s_SearchArchivalMemoryServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddRequiredParameter("query", query) .AddOptionalParameter("tags", tags?.ToString()) .AddOptionalParameter("tag_match_mode", tagMatchMode?.ToValueString()) .AddOptionalParameter("top_k", topK?.ToString()) .AddOptionalParameter("start_datetime", startDatetime?.ToString()) - .AddOptionalParameter("end_datetime", endDatetime?.ToString()) + .AddOptionalParameter("end_datetime", endDatetime?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +290,8 @@ partial void ProcessSearchArchivalMemoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -242,6 +302,11 @@ partial void ProcessSearchArchivalMemoryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -259,6 +324,8 @@ partial void ProcessSearchArchivalMemoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -268,8 +335,7 @@ partial void ProcessSearchArchivalMemoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +344,11 @@ partial void ProcessSearchArchivalMemoryResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -294,14 +365,15 @@ partial void ProcessSearchArchivalMemoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -341,6 +413,8 @@ partial void ProcessSearchArchivalMemoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -361,6 +435,8 @@ partial void ProcessSearchArchivalMemoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -423,9 +499,13 @@ partial void ProcessSearchArchivalMemoryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ArchivalMemorySearchResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ArchivalMemorySearchResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -453,9 +533,13 @@ partial void ProcessSearchArchivalMemoryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ArchivalMemorySearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ArchivalMemorySearchResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs index 9b57d660..478c8ec5 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.SearchMessages.g.cs @@ -65,6 +65,30 @@ partial void ProcessSearchMessagesResponseContent( /// public async global::System.Threading.Tasks.Task> SearchMessagesAsync( + global::Letta.MessageSearchRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchMessagesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search Messages
+ /// Search messages across the entire organization with optional project and template filtering. Returns messages with FTS/vector ranks and total RRF score.
+ /// This is a cloud-only feature. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> SearchMessagesAsResponseAsync( + global::Letta.MessageSearchRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -99,6 +123,7 @@ partial void ProcessSearchMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/agents/messages/search", baseUri: ResolveBaseUri( @@ -180,6 +205,8 @@ partial void ProcessSearchMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +217,11 @@ partial void ProcessSearchMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +239,8 @@ partial void ProcessSearchMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +250,7 @@ partial void ProcessSearchMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +259,11 @@ partial void ProcessSearchMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +280,15 @@ partial void ProcessSearchMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +328,8 @@ partial void ProcessSearchMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +350,8 @@ partial void ProcessSearchMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +414,13 @@ partial void ProcessSearchMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +448,13 @@ partial void ProcessSearchMessagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.SendMessage.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.SendMessage.g.cs index 4648b965..1032ec00 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.SendMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.SendMessage.g.cs @@ -83,6 +83,45 @@ partial void ProcessSendMessageResponseContent( public async global::System.Threading.Tasks.Task SendMessageAsync( string agentId, + global::Letta.LettaStreamingRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SendMessageAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Send Message
+ /// Process a user message and return the agent's response.
+ /// This endpoint accepts a message from a user and processes it through the agent.
+ /// **Note:** Sending multiple concurrent requests to the same agent can lead to undefined behavior.
+ /// Each agent processes messages sequentially, and concurrent requests may interleave in unexpected ways.
+ /// Wait for each request to complete before sending the next one. Use separate agents or conversations for parallel processing.
+ /// The response format is controlled by the `streaming` field in the request body:
+ /// - If `streaming=false` (default): Returns a complete LettaResponse with all messages
+ /// - If `streaming=true`: Returns a Server-Sent Events (SSE) stream
+ /// Additional streaming options (only used when streaming=true):
+ /// - `stream_tokens`: Stream individual tokens instead of complete steps
+ /// - `include_pings`: Include keepalive pings to prevent connection timeouts
+ /// - `background`: Process the request in the background + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SendMessageAsResponseAsync( + string agentId, + global::Letta.LettaStreamingRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -118,6 +157,7 @@ partial void ProcessSendMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/messages", baseUri: ResolveBaseUri( @@ -200,6 +240,8 @@ partial void ProcessSendMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -210,6 +252,11 @@ partial void ProcessSendMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -227,6 +274,8 @@ partial void ProcessSendMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -236,8 +285,7 @@ partial void ProcessSendMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -246,6 +294,11 @@ partial void ProcessSendMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -262,14 +315,15 @@ partial void ProcessSendMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +363,8 @@ partial void ProcessSendMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -329,6 +385,8 @@ partial void ProcessSendMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -391,9 +449,13 @@ partial void ProcessSendMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.LettaResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.LettaResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -421,9 +483,13 @@ partial void ProcessSendMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.LettaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.LettaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.SummarizeMessages.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.SummarizeMessages.g.cs index e63b0744..5f871b22 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.SummarizeMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.SummarizeMessages.g.cs @@ -70,6 +70,34 @@ partial void ProcessSummarizeMessagesResponseContent( public async global::System.Threading.Tasks.Task SummarizeMessagesAsync( string agentId, + global::Letta.LettaServerRestApiRoutersV1AgentsCompactionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SummarizeMessagesAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Summarize Messages
+ /// Summarize an agent's conversation history. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SummarizeMessagesAsResponseAsync( + string agentId, + global::Letta.LettaServerRestApiRoutersV1AgentsCompactionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessSummarizeMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/summarize", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessSummarizeMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessSummarizeMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessSummarizeMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessSummarizeMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessSummarizeMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessSummarizeMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessSummarizeMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessSummarizeMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessSummarizeMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.CompactionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.CompactionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessSummarizeMessagesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.CompactionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.CompactionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.AgentsClient.g.cs b/src/libs/Letta/Generated/Letta.AgentsClient.g.cs index dbe1102e..878e90b3 100644 --- a/src/libs/Letta/Generated/Letta.AgentsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.AgentsClient.g.cs @@ -103,10 +103,10 @@ public AgentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public AgentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.CreateArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.CreateArchive.g.cs index 9a08fd05..4eba9e92 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.CreateArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.CreateArchive.g.cs @@ -66,6 +66,29 @@ partial void ProcessCreateArchiveResponseContent( /// public async global::System.Threading.Tasks.Task CreateArchiveAsync( + global::Letta.ArchiveCreateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateArchiveAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Archive
+ /// Create a new archive. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateArchiveAsResponseAsync( + global::Letta.ArchiveCreateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -100,6 +123,7 @@ partial void ProcessCreateArchiveResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/archives/", baseUri: ResolveBaseUri( @@ -181,6 +205,8 @@ partial void ProcessCreateArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +217,11 @@ partial void ProcessCreateArchiveResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +239,8 @@ partial void ProcessCreateArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +250,7 @@ partial void ProcessCreateArchiveResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +259,11 @@ partial void ProcessCreateArchiveResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +280,15 @@ partial void ProcessCreateArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +328,8 @@ partial void ProcessCreateArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +350,8 @@ partial void ProcessCreateArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -372,9 +414,13 @@ partial void ProcessCreateArchiveResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Archive.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Archive.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -402,9 +448,13 @@ partial void ProcessCreateArchiveResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Archive.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Archive.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassageInArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassageInArchive.g.cs index 9896c784..e6684ed0 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassageInArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassageInArchive.g.cs @@ -71,6 +71,35 @@ partial void ProcessCreatePassageInArchiveResponseContent( public async global::System.Threading.Tasks.Task CreatePassageInArchiveAsync( string archiveId, + global::Letta.PassageCreateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreatePassageInArchiveAsResponseAsync( + archiveId: archiveId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Passage In Archive
+ /// Create a new passage in an archive.
+ /// This adds a passage to the archive and creates embeddings for vector storage. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreatePassageInArchiveAsResponseAsync( + string archiveId, + global::Letta.PassageCreateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -106,6 +135,7 @@ partial void ProcessCreatePassageInArchiveResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}/passages", baseUri: ResolveBaseUri( @@ -188,6 +218,8 @@ partial void ProcessCreatePassageInArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +230,11 @@ partial void ProcessCreatePassageInArchiveResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +252,8 @@ partial void ProcessCreatePassageInArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +263,7 @@ partial void ProcessCreatePassageInArchiveResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +272,11 @@ partial void ProcessCreatePassageInArchiveResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +293,15 @@ partial void ProcessCreatePassageInArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +341,8 @@ partial void ProcessCreatePassageInArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +363,8 @@ partial void ProcessCreatePassageInArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,9 +427,13 @@ partial void ProcessCreatePassageInArchiveResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Passage.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Passage.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -409,9 +461,13 @@ partial void ProcessCreatePassageInArchiveResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Passage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Passage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassagesInArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassagesInArchive.g.cs index 19747008..00b6f395 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassagesInArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.CreatePassagesInArchive.g.cs @@ -71,6 +71,35 @@ partial void ProcessCreatePassagesInArchiveResponseContent( public async global::System.Threading.Tasks.Task> CreatePassagesInArchiveAsync( string archiveId, + global::Letta.PassageBatchCreateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreatePassagesInArchiveAsResponseAsync( + archiveId: archiveId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Passages In Archive
+ /// Create multiple passages in an archive.
+ /// This adds passages to the archive and creates embeddings for vector storage. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> CreatePassagesInArchiveAsResponseAsync( + string archiveId, + global::Letta.PassageBatchCreateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -106,6 +135,7 @@ partial void ProcessCreatePassagesInArchiveResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}/passages/batch", baseUri: ResolveBaseUri( @@ -188,6 +218,8 @@ partial void ProcessCreatePassagesInArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +230,11 @@ partial void ProcessCreatePassagesInArchiveResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +252,8 @@ partial void ProcessCreatePassagesInArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +263,7 @@ partial void ProcessCreatePassagesInArchiveResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +272,11 @@ partial void ProcessCreatePassagesInArchiveResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +293,15 @@ partial void ProcessCreatePassagesInArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +341,8 @@ partial void ProcessCreatePassagesInArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +363,8 @@ partial void ProcessCreatePassagesInArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,9 +427,13 @@ partial void ProcessCreatePassagesInArchiveResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -409,9 +461,13 @@ partial void ProcessCreatePassagesInArchiveResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.DeleteArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.DeleteArchive.g.cs index a6111448..b075d7ba 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.DeleteArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.DeleteArchive.g.cs @@ -63,6 +63,27 @@ partial void ProcessDeleteArchiveResponse( string archiveId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteArchiveAsResponseAsync( + archiveId: archiveId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Archive
+ /// Delete an archive by its ID. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteArchiveAsResponseAsync( + string archiveId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -92,6 +113,7 @@ partial void ProcessDeleteArchiveResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}", baseUri: ResolveBaseUri( @@ -167,6 +189,8 @@ partial void ProcessDeleteArchiveResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -177,6 +201,11 @@ partial void ProcessDeleteArchiveResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -194,6 +223,8 @@ partial void ProcessDeleteArchiveResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -203,8 +234,7 @@ partial void ProcessDeleteArchiveResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -213,6 +243,11 @@ partial void ProcessDeleteArchiveResponse( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -229,14 +264,15 @@ partial void ProcessDeleteArchiveResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -276,6 +312,8 @@ partial void ProcessDeleteArchiveResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -296,6 +334,8 @@ partial void ProcessDeleteArchiveResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,6 +394,10 @@ partial void ProcessDeleteArchiveResponse( { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -375,6 +419,10 @@ partial void ProcessDeleteArchiveResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.DeletePassageFromArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.DeletePassageFromArchive.g.cs index 21c16f34..4c156c59 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.DeletePassageFromArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.DeletePassageFromArchive.g.cs @@ -70,6 +70,33 @@ partial void ProcessDeletePassageFromArchiveResponse( string passageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeletePassageFromArchiveAsResponseAsync( + archiveId: archiveId, + passageId: passageId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Passage From Archive
+ /// Delete a passage from an archive.
+ /// This permanently removes the passage from both the database and vector storage (if applicable). + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// The ID of the passage in the format 'passage-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeletePassageFromArchiveAsResponseAsync( + string archiveId, + string passageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +127,7 @@ partial void ProcessDeletePassageFromArchiveResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}/passages/{passageId}", baseUri: ResolveBaseUri( @@ -176,6 +204,8 @@ partial void ProcessDeletePassageFromArchiveResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +216,11 @@ partial void ProcessDeletePassageFromArchiveResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +238,8 @@ partial void ProcessDeletePassageFromArchiveResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +249,7 @@ partial void ProcessDeletePassageFromArchiveResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +258,11 @@ partial void ProcessDeletePassageFromArchiveResponse( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +279,15 @@ partial void ProcessDeletePassageFromArchiveResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +327,8 @@ partial void ProcessDeletePassageFromArchiveResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +349,8 @@ partial void ProcessDeletePassageFromArchiveResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,6 +409,10 @@ partial void ProcessDeletePassageFromArchiveResponse( { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -384,6 +434,10 @@ partial void ProcessDeletePassageFromArchiveResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.ListAgentsForArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.ListAgentsForArchive.g.cs index 93835e82..2c392fdc 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.ListAgentsForArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.ListAgentsForArchive.g.cs @@ -101,6 +101,57 @@ partial void ProcessListAgentsForArchiveResponseContent( global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsForArchiveAsResponseAsync( + archiveId: archiveId, + before: before, + after: after, + limit: limit, + order: order, + include: include, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents For Archive
+ /// Get a list of agents that have access to an archive with pagination support. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsForArchiveAsResponseAsync( + string archiveId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForArchiveOrder? order = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListAgentsForArchiveResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}/agents", baseUri: ResolveBaseUri( servers: s_ListAgentsForArchiveServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListAgentsForArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListAgentsForArchiveResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListAgentsForArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListAgentsForArchiveResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListAgentsForArchiveResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListAgentsForArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListAgentsForArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListAgentsForArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListAgentsForArchiveResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListAgentsForArchiveResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.ListArchives.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.ListArchives.g.cs index 2f772b43..391900d7 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.ListArchives.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.ListArchives.g.cs @@ -107,6 +107,62 @@ partial void ProcessListArchivesResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListArchivesAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + name: name, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Archives
+ /// Get a list of all archives for the current organization with optional filters and pagination. + ///
+ /// + /// Archive ID cursor for pagination. Returns archives that come before this archive ID in the specified sort order + /// + /// + /// Archive ID cursor for pagination. Returns archives that come after this archive ID in the specified sort order + /// + /// + /// Maximum number of archives to return
+ /// Default Value: 50 + /// + /// + /// Sort order for archives by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter by archive name (exact match) + /// + /// + /// Only archives attached to this agent ID + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListArchivesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListArchivesOrder? order = default, + string? orderBy = default, + string? name = default, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -142,11 +198,12 @@ partial void ProcessListArchivesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/archives/", baseUri: ResolveBaseUri( servers: s_ListArchivesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -154,7 +211,7 @@ partial void ProcessListArchivesResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("name", name) - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +289,8 @@ partial void ProcessListArchivesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -242,6 +301,11 @@ partial void ProcessListArchivesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -259,6 +323,8 @@ partial void ProcessListArchivesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -268,8 +334,7 @@ partial void ProcessListArchivesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +343,11 @@ partial void ProcessListArchivesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -294,14 +364,15 @@ partial void ProcessListArchivesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -341,6 +412,8 @@ partial void ProcessListArchivesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -361,6 +434,8 @@ partial void ProcessListArchivesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -423,9 +498,13 @@ partial void ProcessListArchivesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -453,9 +532,13 @@ partial void ProcessListArchivesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.ModifyArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.ModifyArchive.g.cs index eef369fb..6bf9b29b 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.ModifyArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.ModifyArchive.g.cs @@ -70,6 +70,34 @@ partial void ProcessModifyArchiveResponseContent( public async global::System.Threading.Tasks.Task ModifyArchiveAsync( string archiveId, + global::Letta.ArchiveUpdateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyArchiveAsResponseAsync( + archiveId: archiveId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Archive
+ /// Update an existing archive's name and/or description. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyArchiveAsResponseAsync( + string archiveId, + global::Letta.ArchiveUpdateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessModifyArchiveResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessModifyArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessModifyArchiveResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessModifyArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessModifyArchiveResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessModifyArchiveResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessModifyArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessModifyArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessModifyArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessModifyArchiveResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Archive.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Archive.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessModifyArchiveResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Archive.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Archive.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.RetrieveArchive.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.RetrieveArchive.g.cs index 4c210388..03d01f57 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.RetrieveArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.RetrieveArchive.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveArchiveResponseContent( string archiveId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveArchiveAsResponseAsync( + archiveId: archiveId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Archive
+ /// Get a single archive by its ID. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveArchiveAsResponseAsync( + string archiveId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveArchiveResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/archives/{archiveId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveArchiveResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveArchiveResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveArchiveResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveArchiveResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveArchiveResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveArchiveResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Archive.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Archive.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveArchiveResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Archive.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Archive.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ArchivesClient.g.cs b/src/libs/Letta/Generated/Letta.ArchivesClient.g.cs index 1f8db026..bc3d3fca 100644 --- a/src/libs/Letta/Generated/Letta.ArchivesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ArchivesClient.g.cs @@ -103,10 +103,10 @@ public ArchivesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ArchivesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.AutoSDKHttpResponse.g.cs b/src/libs/Letta/Generated/Letta.AutoSDKHttpResponse.g.cs new file mode 100644 index 00000000..22292dd3 --- /dev/null +++ b/src/libs/Letta/Generated/Letta.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace Letta +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.AttachIdentityToBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.AttachIdentityToBlock.g.cs index e2e91e83..faebcb27 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.AttachIdentityToBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.AttachIdentityToBlock.g.cs @@ -72,6 +72,32 @@ partial void ProcessAttachIdentityToBlockResponseContent( string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AttachIdentityToBlockAsResponseAsync( + identityId: identityId, + blockId: blockId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Attach Identity To Block
+ /// Attach an identity to a block. + ///
+ /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AttachIdentityToBlockAsResponseAsync( + string identityId, + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessAttachIdentityToBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/blocks/{blockId}/identities/attach/{identityId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessAttachIdentityToBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessAttachIdentityToBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessAttachIdentityToBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessAttachIdentityToBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessAttachIdentityToBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessAttachIdentityToBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessAttachIdentityToBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessAttachIdentityToBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +414,13 @@ partial void ProcessAttachIdentityToBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -399,9 +448,13 @@ partial void ProcessAttachIdentityToBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.CountBlocks.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.CountBlocks.g.cs index 828548d4..aa66f1e0 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.CountBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.CountBlocks.g.cs @@ -101,6 +101,57 @@ partial void ProcessCountBlocksResponseContent( string? projectId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CountBlocksAsResponseAsync( + label: label, + templatesOnly: templatesOnly, + name: name, + tags: tags, + matchAllTags: matchAllTags, + projectId: projectId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Blocks
+ /// Count all blocks with optional filtering.
+ /// Supports the same filters as list_blocks for consistent querying. + ///
+ /// + /// Label to include (alphanumeric, hyphens, underscores, forward slashes) + /// + /// + /// Whether to include only templates
+ /// Default Value: false + /// + /// + /// Name filter (alphanumeric, spaces, hyphens, underscores) + /// + /// + /// List of tags to filter blocks by + /// + /// + /// If True, only counts blocks that match ALL given tags. Otherwise, counts blocks that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Search blocks by project id + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CountBlocksAsResponseAsync( + string? label = default, + bool? templatesOnly = default, + string? name = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + string? projectId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,18 +186,19 @@ partial void ProcessCountBlocksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/blocks/count", baseUri: ResolveBaseUri( servers: s_CountBlocksServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("label", label) .AddOptionalParameter("templates_only", templatesOnly?.ToString().ToLowerInvariant()) .AddOptionalParameter("name", name) .AddOptionalParameter("tags", tags?.ToString()) .AddOptionalParameter("match_all_tags", matchAllTags?.ToString().ToLowerInvariant()) - .AddOptionalParameter("project_id", projectId) + .AddOptionalParameter("project_id", projectId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -223,6 +275,8 @@ partial void ProcessCountBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +287,11 @@ partial void ProcessCountBlocksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +309,8 @@ partial void ProcessCountBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +320,7 @@ partial void ProcessCountBlocksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +329,11 @@ partial void ProcessCountBlocksResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +350,15 @@ partial void ProcessCountBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +398,8 @@ partial void ProcessCountBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +420,8 @@ partial void ProcessCountBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -414,9 +484,13 @@ partial void ProcessCountBlocksResponseContent( { __response.EnsureSuccessStatusCode(); - return - (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? + var __value = (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +518,13 @@ partial void ProcessCountBlocksResponseContent( #endif ).ConfigureAwait(false); - return - (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.CreateBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.CreateBlock.g.cs index 5d8384a3..18cb8ac2 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.CreateBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.CreateBlock.g.cs @@ -63,6 +63,28 @@ partial void ProcessCreateBlockResponseContent( /// public async global::System.Threading.Tasks.Task CreateBlockAsync( + global::Letta.CreateBlock request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateBlockAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Block + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateBlockAsResponseAsync( + global::Letta.CreateBlock request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,6 +119,7 @@ partial void ProcessCreateBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/blocks/", baseUri: ResolveBaseUri( @@ -178,6 +201,8 @@ partial void ProcessCreateBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +213,11 @@ partial void ProcessCreateBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +235,8 @@ partial void ProcessCreateBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +246,7 @@ partial void ProcessCreateBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +255,11 @@ partial void ProcessCreateBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +276,15 @@ partial void ProcessCreateBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +324,8 @@ partial void ProcessCreateBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +346,8 @@ partial void ProcessCreateBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +410,13 @@ partial void ProcessCreateBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -399,9 +444,13 @@ partial void ProcessCreateBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.DeleteBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.DeleteBlock.g.cs index f10a396d..30ea5aea 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.DeleteBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.DeleteBlock.g.cs @@ -67,6 +67,28 @@ partial void ProcessDeleteBlockResponseContent( string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteBlockAsResponseAsync( + blockId: blockId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteBlockAsResponseAsync( + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +118,7 @@ partial void ProcessDeleteBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/blocks/{blockId}", baseUri: ResolveBaseUri( @@ -171,6 +194,8 @@ partial void ProcessDeleteBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +206,11 @@ partial void ProcessDeleteBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -198,6 +228,8 @@ partial void ProcessDeleteBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +239,7 @@ partial void ProcessDeleteBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +248,11 @@ partial void ProcessDeleteBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -233,14 +269,15 @@ partial void ProcessDeleteBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +317,8 @@ partial void ProcessDeleteBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +339,8 @@ partial void ProcessDeleteBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,7 +403,11 @@ partial void ProcessDeleteBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -390,7 +435,11 @@ partial void ProcessDeleteBlockResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.DetachIdentityFromBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.DetachIdentityFromBlock.g.cs index e4e37e72..37ccde9a 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.DetachIdentityFromBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.DetachIdentityFromBlock.g.cs @@ -72,6 +72,32 @@ partial void ProcessDetachIdentityFromBlockResponseContent( string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetachIdentityFromBlockAsResponseAsync( + identityId: identityId, + blockId: blockId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detach Identity From Block
+ /// Detach an identity from a block. + ///
+ /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetachIdentityFromBlockAsResponseAsync( + string identityId, + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,6 +128,7 @@ partial void ProcessDetachIdentityFromBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/blocks/{blockId}/identities/detach/{identityId}", baseUri: ResolveBaseUri( @@ -178,6 +205,8 @@ partial void ProcessDetachIdentityFromBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +217,11 @@ partial void ProcessDetachIdentityFromBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +239,8 @@ partial void ProcessDetachIdentityFromBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +250,7 @@ partial void ProcessDetachIdentityFromBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +259,11 @@ partial void ProcessDetachIdentityFromBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +280,15 @@ partial void ProcessDetachIdentityFromBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +328,8 @@ partial void ProcessDetachIdentityFromBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +350,8 @@ partial void ProcessDetachIdentityFromBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +414,13 @@ partial void ProcessDetachIdentityFromBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -399,9 +448,13 @@ partial void ProcessDetachIdentityFromBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.ListAgentsForBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.ListAgentsForBlock.g.cs index f33ef324..6f8f7c73 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.ListAgentsForBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.ListAgentsForBlock.g.cs @@ -117,6 +117,69 @@ partial void ProcessListAgentsForBlockResponseContent( global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsForBlockAsResponseAsync( + blockId: blockId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + includeRelationships: includeRelationships, + include: include, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents For Block
+ /// Retrieves all agents associated with the specified block.
+ /// Raises a 404 if the block does not exist. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsForBlockAsResponseAsync( + string blockId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForBlockOrder? order = default, + string? orderBy = default, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -153,11 +216,12 @@ partial void ProcessListAgentsForBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/blocks/{blockId}/agents", baseUri: ResolveBaseUri( servers: s_ListAgentsForBlockServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -165,7 +229,7 @@ partial void ProcessListAgentsForBlockResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("include_relationships", includeRelationships?.ToString()) - .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true) + .AddOptionalParameter("include", include, selector: static x => x.ToValueString(), delimiter: ",", explode: true) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -244,6 +308,8 @@ partial void ProcessListAgentsForBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -254,6 +320,11 @@ partial void ProcessListAgentsForBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -271,6 +342,8 @@ partial void ProcessListAgentsForBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -280,8 +353,7 @@ partial void ProcessListAgentsForBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +362,11 @@ partial void ProcessListAgentsForBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -306,14 +383,15 @@ partial void ProcessListAgentsForBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -353,6 +431,8 @@ partial void ProcessListAgentsForBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -373,6 +453,8 @@ partial void ProcessListAgentsForBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -435,9 +517,13 @@ partial void ProcessListAgentsForBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -465,9 +551,13 @@ partial void ProcessListAgentsForBlockResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.ListBlocks.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.ListBlocks.g.cs index e371315f..e1e06471 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.ListBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.ListBlocks.g.cs @@ -180,6 +180,123 @@ partial void ProcessListBlocksResponseContent( global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListBlocksAsResponseAsync( + label: label, + templatesOnly: templatesOnly, + name: name, + identityId: identityId, + identifierKeys: identifierKeys, + projectId: projectId, + tags: tags, + matchAllTags: matchAllTags, + limit: limit, + before: before, + after: after, + order: order, + orderBy: orderBy, + labelSearch: labelSearch, + descriptionSearch: descriptionSearch, + valueSearch: valueSearch, + connectedToAgentsCountGt: connectedToAgentsCountGt, + connectedToAgentsCountLt: connectedToAgentsCountLt, + connectedToAgentsCountEq: connectedToAgentsCountEq, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Blocks + /// + /// + /// Label to include (alphanumeric, hyphens, underscores, forward slashes) + /// + /// + /// Whether to include only templates
+ /// Default Value: false + /// + /// + /// Name filter (alphanumeric, spaces, hyphens, underscores) + /// + /// + /// The ID of the identity in the format 'identity-<uuid4>' + /// + /// + /// Search agents by identifier keys + /// + /// + /// Search blocks by project id + /// + /// + /// List of tags to filter blocks by + /// + /// + /// If True, only returns blocks that match ALL given tags. Otherwise, return blocks that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Number of blocks to return
+ /// Default Value: 50 + /// + /// + /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order + /// + /// + /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order + /// + /// + /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Search blocks by label. If provided, returns blocks whose label matches the search query. This is a full-text search on block labels. + /// + /// + /// Search blocks by description. If provided, returns blocks whose description matches the search query. This is a full-text search on block descriptions. + /// + /// + /// Search blocks by value. If provided, returns blocks whose value matches the search query. This is a full-text search on block values. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have more than this number of connected agents. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have less than this number of connected agents. + /// + /// + /// Filter blocks by the exact number of connected agents. If provided, returns blocks that have exactly this number of connected agents. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListBlocksAsResponseAsync( + string? label = default, + bool? templatesOnly = default, + string? name = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + string? projectId = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + int? limit = default, + string? before = default, + string? after = default, + global::Letta.ListBlocksOrder? order = default, + string? orderBy = default, + string? labelSearch = default, + string? descriptionSearch = default, + string? valueSearch = default, + int? connectedToAgentsCountGt = default, + int? connectedToAgentsCountLt = default, + global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -227,11 +344,12 @@ partial void ProcessListBlocksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/blocks/", baseUri: ResolveBaseUri( servers: s_ListBlocksServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("label", label) .AddOptionalParameter("templates_only", templatesOnly?.ToString().ToLowerInvariant()) @@ -251,7 +369,7 @@ partial void ProcessListBlocksResponseContent( .AddOptionalParameter("value_search", valueSearch) .AddOptionalParameter("connected_to_agents_count_gt", connectedToAgentsCountGt?.ToString()) .AddOptionalParameter("connected_to_agents_count_lt", connectedToAgentsCountLt?.ToString()) - .AddOptionalParameter("connected_to_agents_count_eq", connectedToAgentsCountEq?.ToString()) + .AddOptionalParameter("connected_to_agents_count_eq", connectedToAgentsCountEq?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -341,6 +459,8 @@ partial void ProcessListBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -351,6 +471,11 @@ partial void ProcessListBlocksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -368,6 +493,8 @@ partial void ProcessListBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -377,8 +504,7 @@ partial void ProcessListBlocksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -387,6 +513,11 @@ partial void ProcessListBlocksResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -403,14 +534,15 @@ partial void ProcessListBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -450,6 +582,8 @@ partial void ProcessListBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -470,6 +604,8 @@ partial void ProcessListBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -532,9 +668,13 @@ partial void ProcessListBlocksResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -562,9 +702,13 @@ partial void ProcessListBlocksResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.ModifyBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.ModifyBlock.g.cs index 9c9fb338..90a328db 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.ModifyBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.ModifyBlock.g.cs @@ -69,6 +69,33 @@ partial void ProcessModifyBlockResponseContent( public async global::System.Threading.Tasks.Task ModifyBlockAsync( string blockId, + global::Letta.BlockUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyBlockAsResponseAsync( + blockId: blockId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyBlockAsResponseAsync( + string blockId, + global::Letta.BlockUpdate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -104,6 +131,7 @@ partial void ProcessModifyBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/blocks/{blockId}", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessModifyBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessModifyBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessModifyBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessModifyBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessModifyBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessModifyBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessModifyBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessModifyBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -377,9 +423,13 @@ partial void ProcessModifyBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -407,9 +457,13 @@ partial void ProcessModifyBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.RetrieveBlock.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.RetrieveBlock.g.cs index 7ad1ce31..52ec2b9e 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.RetrieveBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.RetrieveBlock.g.cs @@ -67,6 +67,28 @@ partial void ProcessRetrieveBlockResponseContent( string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveBlockAsResponseAsync( + blockId: blockId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveBlockAsResponseAsync( + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +118,7 @@ partial void ProcessRetrieveBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/blocks/{blockId}", baseUri: ResolveBaseUri( @@ -171,6 +194,8 @@ partial void ProcessRetrieveBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +206,11 @@ partial void ProcessRetrieveBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -198,6 +228,8 @@ partial void ProcessRetrieveBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +239,7 @@ partial void ProcessRetrieveBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +248,11 @@ partial void ProcessRetrieveBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -233,14 +269,15 @@ partial void ProcessRetrieveBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +317,8 @@ partial void ProcessRetrieveBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +339,8 @@ partial void ProcessRetrieveBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,9 +403,13 @@ partial void ProcessRetrieveBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BlockResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -392,9 +437,13 @@ partial void ProcessRetrieveBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BlockResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.BlocksClient.g.cs b/src/libs/Letta/Generated/Letta.BlocksClient.g.cs index 40d9b26d..73b74ec2 100644 --- a/src/libs/Letta/Generated/Letta.BlocksClient.g.cs +++ b/src/libs/Letta/Generated/Letta.BlocksClient.g.cs @@ -103,10 +103,10 @@ public BlocksClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BlocksClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ChatClient.CreateChatCompletion.g.cs b/src/libs/Letta/Generated/Letta.ChatClient.CreateChatCompletion.g.cs index b2913791..8aac72df 100644 --- a/src/libs/Letta/Generated/Letta.ChatClient.CreateChatCompletion.g.cs +++ b/src/libs/Letta/Generated/Letta.ChatClient.CreateChatCompletion.g.cs @@ -68,6 +68,33 @@ partial void ProcessCreateChatCompletionResponseContent( /// public async global::System.Threading.Tasks.Task CreateChatCompletionAsync( + global::Letta.ChatCompletionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateChatCompletionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Chat Completion
+ /// Create a chat completion using a Letta agent (OpenAI-compatible).
+ /// This endpoint provides full OpenAI API compatibility. The agent is selected based on:
+ /// - The 'model' parameter in the request (should contain an agent ID in format 'agent-...')
+ /// When streaming is enabled (stream=true), the response will be Server-Sent Events
+ /// with ChatCompletionChunk objects. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateChatCompletionAsResponseAsync( + global::Letta.ChatCompletionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,10 +125,11 @@ partial void ProcessCreateChatCompletionResponseContent( var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/chat/completions", baseUri: ResolveBaseUri( @@ -183,6 +211,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -193,6 +223,11 @@ partial void ProcessCreateChatCompletionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -210,6 +245,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -219,8 +256,7 @@ partial void ProcessCreateChatCompletionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -229,6 +265,11 @@ partial void ProcessCreateChatCompletionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -245,14 +286,15 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -292,6 +334,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -312,6 +356,8 @@ partial void ProcessCreateChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -374,9 +420,13 @@ partial void ProcessCreateChatCompletionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ChatCompletion.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ChatCompletion.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,9 +454,13 @@ partial void ProcessCreateChatCompletionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ChatCompletion.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ChatCompletion.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ChatClient.g.cs b/src/libs/Letta/Generated/Letta.ChatClient.g.cs index c21b963e..bc97c85f 100644 --- a/src/libs/Letta/Generated/Letta.ChatClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ChatClient.g.cs @@ -103,10 +103,10 @@ public ChatClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ChatClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs index 4c7c5b92..a2c859d7 100644 --- a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs +++ b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs @@ -64,6 +64,29 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon /// public async global::System.Threading.Tasks.Task ClientSideAccessTokensCreateClientSideAccessTokenAsync( + global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ClientSideAccessTokensCreateClientSideAccessTokenAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create token (Cloud-only)
+ /// Create a new client side access token with the specified configuration. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ClientSideAccessTokensCreateClientSideAccessTokenAsResponseAsync( + global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/client-side-access-tokens", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -370,9 +412,13 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon { __response.EnsureSuccessStatusCode(); - return - global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessClientSideAccessTokensCreateClientSideAccessTokenResponseCon #endif ).ConfigureAwait(false); - return - await global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs index d459ee61..e4fcbed9 100644 --- a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs +++ b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs @@ -68,6 +68,32 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon public async global::System.Threading.Tasks.Task ClientSideAccessTokensDeleteClientSideAccessTokenAsync( string token, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ClientSideAccessTokensDeleteClientSideAccessTokenAsResponseAsync( + token: token, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete token (Cloud-only)
+ /// Delete a client side access token. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ClientSideAccessTokensDeleteClientSideAccessTokenAsResponseAsync( + string token, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/client-side-access-tokens/{token}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -376,7 +421,11 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -404,7 +453,11 @@ partial void ProcessClientSideAccessTokensDeleteClientSideAccessTokenResponseCon #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs index 56e83978..daa7ea2b 100644 --- a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs +++ b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs @@ -78,6 +78,37 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont double? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ClientSideAccessTokensListClientSideAccessTokensAsResponseAsync( + agentId: agentId, + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List tokens (Cloud-only)
+ /// List all client side access tokens for the current account. This is only available for cloud users. + ///
+ /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ClientSideAccessTokensListClientSideAccessTokensAsResponseAsync( + string? agentId = default, + double? offset = default, + double? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,15 +140,16 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/client-side-access-tokens", baseUri: ResolveBaseUri( servers: s_ClientSideAccessTokensListClientSideAccessTokensServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("agentId", agentId) .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -191,6 +223,8 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +235,11 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +257,8 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +268,7 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +277,11 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +298,15 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +346,8 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +368,8 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -382,9 +432,13 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont { __response.EnsureSuccessStatusCode(); - return - global::Letta.ClientSideAccessTokensListClientSideAccessTokensResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ClientSideAccessTokensListClientSideAccessTokensResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +466,13 @@ partial void ProcessClientSideAccessTokensListClientSideAccessTokensResponseCont #endif ).ConfigureAwait(false); - return - await global::Letta.ClientSideAccessTokensListClientSideAccessTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ClientSideAccessTokensListClientSideAccessTokensResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.g.cs b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.g.cs index 44068593..9e071f83 100644 --- a/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ClientSideAccessTokensClient.g.cs @@ -103,10 +103,10 @@ public ClientSideAccessTokensClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ClientSideAccessTokensClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.CancelConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.CancelConversation.g.cs index d8436efd..7d595b2e 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.CancelConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.CancelConversation.g.cs @@ -78,6 +78,38 @@ partial void ProcessCancelConversationResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelConversationAsResponseAsync( + conversationId: conversationId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel Conversation
+ /// Cancel runs associated with a conversation.
+ /// Note: To cancel active runs, Redis is required.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id query parameter
+ /// to cancel runs for the agent's default conversation.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Agent ID for agent-direct mode with 'default' conversation + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CancelConversationAsResponseAsync( + string conversationId, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -108,13 +140,14 @@ partial void ProcessCancelConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/cancel", baseUri: ResolveBaseUri( servers: s_CancelConversationServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -187,6 +220,8 @@ partial void ProcessCancelConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +232,11 @@ partial void ProcessCancelConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +254,8 @@ partial void ProcessCancelConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +265,7 @@ partial void ProcessCancelConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +274,11 @@ partial void ProcessCancelConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +295,15 @@ partial void ProcessCancelConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +343,8 @@ partial void ProcessCancelConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +365,8 @@ partial void ProcessCancelConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,7 +429,11 @@ partial void ProcessCancelConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -406,7 +461,11 @@ partial void ProcessCancelConversationResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.CompactConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.CompactConversation.g.cs index 543ed4d3..918df3c0 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.CompactConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.CompactConversation.g.cs @@ -75,6 +75,39 @@ partial void ProcessCompactConversationResponseContent( public async global::System.Threading.Tasks.Task CompactConversationAsync( string conversationId, + global::Letta.LettaServerRestApiRoutersV1ConversationsCompactionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CompactConversationAsResponseAsync( + conversationId: conversationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Compact Conversation
+ /// Compact (summarize) a conversation's message history.
+ /// This endpoint summarizes the in-context messages for a specific conversation,
+ /// reducing the message count while preserving important context.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id in request body
+ /// to compact the agent's default conversation messages.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CompactConversationAsResponseAsync( + string conversationId, + global::Letta.LettaServerRestApiRoutersV1ConversationsCompactionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -110,6 +143,7 @@ partial void ProcessCompactConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/compact", baseUri: ResolveBaseUri( @@ -192,6 +226,8 @@ partial void ProcessCompactConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +238,11 @@ partial void ProcessCompactConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +260,8 @@ partial void ProcessCompactConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +271,7 @@ partial void ProcessCompactConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +280,11 @@ partial void ProcessCompactConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +301,15 @@ partial void ProcessCompactConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +349,8 @@ partial void ProcessCompactConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +371,8 @@ partial void ProcessCompactConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -383,9 +435,13 @@ partial void ProcessCompactConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.CompactionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.CompactionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -413,9 +469,13 @@ partial void ProcessCompactConversationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.CompactionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.CompactionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.CreateConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.CreateConversation.g.cs index acbf8a44..5c85c3ad 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.CreateConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.CreateConversation.g.cs @@ -70,6 +70,34 @@ partial void ProcessCreateConversationResponseContent( public async global::System.Threading.Tasks.Task CreateConversationAsync( string agentId, + global::Letta.CreateConversation request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateConversationAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Conversation
+ /// Create a new conversation for an agent. + ///
+ /// + /// The agent ID to create a conversation for + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateConversationAsResponseAsync( + string agentId, + global::Letta.CreateConversation request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,13 +133,14 @@ partial void ProcessCreateConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/conversations/", baseUri: ResolveBaseUri( servers: s_CreateConversationServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddRequiredParameter("agent_id", agentId) + .AddRequiredParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -190,6 +219,8 @@ partial void ProcessCreateConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -200,6 +231,11 @@ partial void ProcessCreateConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -217,6 +253,8 @@ partial void ProcessCreateConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -226,8 +264,7 @@ partial void ProcessCreateConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -236,6 +273,11 @@ partial void ProcessCreateConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -252,14 +294,15 @@ partial void ProcessCreateConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -299,6 +342,8 @@ partial void ProcessCreateConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -319,6 +364,8 @@ partial void ProcessCreateConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -381,9 +428,13 @@ partial void ProcessCreateConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -411,9 +462,13 @@ partial void ProcessCreateConversationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.DeleteConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.DeleteConversation.g.cs index 5cd12489..26606f29 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.DeleteConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.DeleteConversation.g.cs @@ -71,6 +71,32 @@ partial void ProcessDeleteConversationResponseContent( string conversationId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteConversationAsResponseAsync( + conversationId: conversationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Conversation
+ /// Delete a conversation (soft delete).
+ /// This marks the conversation as deleted but does not permanently remove it from the database.
+ /// The conversation will no longer appear in list operations.
+ /// Any isolated blocks associated with the conversation will be permanently deleted. + ///
+ /// + /// The ID of the conv in the format 'conv-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteConversationAsResponseAsync( + string conversationId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +126,7 @@ partial void ProcessDeleteConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}", baseUri: ResolveBaseUri( @@ -175,6 +202,8 @@ partial void ProcessDeleteConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +214,11 @@ partial void ProcessDeleteConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +236,8 @@ partial void ProcessDeleteConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +247,7 @@ partial void ProcessDeleteConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +256,11 @@ partial void ProcessDeleteConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +277,15 @@ partial void ProcessDeleteConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +325,8 @@ partial void ProcessDeleteConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +347,8 @@ partial void ProcessDeleteConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -366,7 +411,11 @@ partial void ProcessDeleteConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -394,7 +443,11 @@ partial void ProcessDeleteConversationResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.ForkConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.ForkConversation.g.cs index 024686f7..85e0513c 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.ForkConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.ForkConversation.g.cs @@ -80,6 +80,40 @@ partial void ProcessForkConversationResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ForkConversationAsResponseAsync( + conversationId: conversationId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fork Conversation
+ /// Fork an existing conversation.
+ /// Creates a new conversation that shares the same in-context messages as the source
+ /// conversation, but with a newly compiled system message reflecting the latest memory
+ /// block values. The forked conversation belongs to the same agent as the source.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id query parameter
+ /// to fork the agent's default (agent-direct) message history into a new conversation.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Agent ID for agent-direct mode with 'default' conversation + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ForkConversationAsResponseAsync( + string conversationId, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,13 +144,14 @@ partial void ProcessForkConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/fork", baseUri: ResolveBaseUri( servers: s_ForkConversationServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -189,6 +224,8 @@ partial void ProcessForkConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -199,6 +236,11 @@ partial void ProcessForkConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -216,6 +258,8 @@ partial void ProcessForkConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -225,8 +269,7 @@ partial void ProcessForkConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -235,6 +278,11 @@ partial void ProcessForkConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -251,14 +299,15 @@ partial void ProcessForkConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -298,6 +347,8 @@ partial void ProcessForkConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -318,6 +369,8 @@ partial void ProcessForkConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -380,9 +433,13 @@ partial void ProcessForkConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -410,9 +467,13 @@ partial void ProcessForkConversationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversationMessages.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversationMessages.g.cs index 8226344d..510928f2 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversationMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversationMessages.g.cs @@ -130,6 +130,82 @@ partial void ProcessListConversationMessagesResponseContent( global::System.Collections.Generic.IList? includeReturnMessageTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListConversationMessagesAsResponseAsync( + conversationId: conversationId, + agentId: agentId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + groupId: groupId, + includeErr: includeErr, + includeReturnMessageTypes: includeReturnMessageTypes, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Conversation Messages
+ /// List all messages in a conversation.
+ /// Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
+ /// messages in the conversation, with support for cursor-based pagination.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id parameter
+ /// to list messages from the agent's default conversation.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Agent ID for agent-direct mode with 'default' conversation + /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Group ID to filter messages by. + /// + /// + /// Whether to include error messages and error statuses. For debugging purposes only. + /// + /// + /// Message types to include in response. When null, all message types are returned. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListConversationMessagesAsResponseAsync( + string conversationId, + string? agentId = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListConversationMessagesOrder? order = default, + string? orderBy = default, + string? groupId = default, + bool? includeErr = default, + global::System.Collections.Generic.IList? includeReturnMessageTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -168,11 +244,12 @@ partial void ProcessListConversationMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/messages", baseUri: ResolveBaseUri( servers: s_ListConversationMessagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("agent_id", agentId) .AddOptionalParameter("before", before) @@ -182,7 +259,7 @@ partial void ProcessListConversationMessagesResponseContent( .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("group_id", groupId) .AddOptionalParameter("include_err", includeErr?.ToString().ToLowerInvariant()) - .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString()) + .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -263,6 +340,8 @@ partial void ProcessListConversationMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -273,6 +352,11 @@ partial void ProcessListConversationMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -290,6 +374,8 @@ partial void ProcessListConversationMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -299,8 +385,7 @@ partial void ProcessListConversationMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -309,6 +394,11 @@ partial void ProcessListConversationMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -325,14 +415,15 @@ partial void ProcessListConversationMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -372,6 +463,8 @@ partial void ProcessListConversationMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -392,6 +485,8 @@ partial void ProcessListConversationMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -454,9 +549,13 @@ partial void ProcessListConversationMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -484,9 +583,13 @@ partial void ProcessListConversationMessagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversations.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversations.g.cs index 8708debb..cd4553b3 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversations.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.ListConversations.g.cs @@ -101,6 +101,57 @@ partial void ProcessListConversationsResponseContent( global::Letta.ListConversationsOrderBy? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListConversationsAsResponseAsync( + agentId: agentId, + limit: limit, + after: after, + summarySearch: summarySearch, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Conversations
+ /// List all conversations for an agent (or all conversations if agent_id not provided). + ///
+ /// + /// The agent ID to list conversations for (optional - returns all conversations if not provided) + /// + /// + /// Maximum number of conversations to return
+ /// Default Value: 50 + /// + /// + /// Cursor for pagination (conversation ID) + /// + /// + /// Search for text within conversation summaries + /// + /// + /// Sort order for conversations. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListConversationsAsResponseAsync( + string? agentId = default, + int? limit = default, + string? after = default, + string? summarySearch = default, + global::Letta.ListConversationsOrder? order = default, + global::Letta.ListConversationsOrderBy? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,18 +186,19 @@ partial void ProcessListConversationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/conversations/", baseUri: ResolveBaseUri( servers: s_ListConversationsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("agent_id", agentId) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("after", after) .AddOptionalParameter("summary_search", summarySearch) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy?.ToValueString()) + .AddOptionalParameter("order_by", orderBy?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -223,6 +275,8 @@ partial void ProcessListConversationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +287,11 @@ partial void ProcessListConversationsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +309,8 @@ partial void ProcessListConversationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +320,7 @@ partial void ProcessListConversationsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +329,11 @@ partial void ProcessListConversationsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +350,15 @@ partial void ProcessListConversationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +398,8 @@ partial void ProcessListConversationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +420,8 @@ partial void ProcessListConversationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -414,9 +484,13 @@ partial void ProcessListConversationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +518,13 @@ partial void ProcessListConversationsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.PreviewConversationModelRequest.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.PreviewConversationModelRequest.g.cs index 6d18e3df..d2bb7cd9 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.PreviewConversationModelRequest.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.PreviewConversationModelRequest.g.cs @@ -76,6 +76,38 @@ partial void ProcessPreviewConversationModelRequestResponseContent( public async global::System.Threading.Tasks.Task PreviewConversationModelRequestAsync( string conversationId, + global::Letta.ConversationMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PreviewConversationModelRequestAsResponseAsync( + conversationId: conversationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Preview Conversation Model Request
+ /// Inspect the raw LLM request payload for a conversation message without sending it.
+ /// This endpoint processes the message through the same path as send_conversation_message
+ /// (including conversation-scoped messages, isolated blocks, model overrides, and
+ /// client tools/skills) but stops before the LLM call and returns the raw request
+ /// payload. Useful for debugging and verifying what the LLM will actually see. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PreviewConversationModelRequestAsResponseAsync( + string conversationId, + global::Letta.ConversationMessageRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -111,6 +143,7 @@ partial void ProcessPreviewConversationModelRequestResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/messages/preview-raw-payload", baseUri: ResolveBaseUri( @@ -193,6 +226,8 @@ partial void ProcessPreviewConversationModelRequestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +238,11 @@ partial void ProcessPreviewConversationModelRequestResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +260,8 @@ partial void ProcessPreviewConversationModelRequestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +271,7 @@ partial void ProcessPreviewConversationModelRequestResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +280,11 @@ partial void ProcessPreviewConversationModelRequestResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +301,15 @@ partial void ProcessPreviewConversationModelRequestResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +349,8 @@ partial void ProcessPreviewConversationModelRequestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +371,8 @@ partial void ProcessPreviewConversationModelRequestResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,7 +435,11 @@ partial void ProcessPreviewConversationModelRequestResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -412,7 +467,11 @@ partial void ProcessPreviewConversationModelRequestResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.RecompileConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.RecompileConversation.g.cs index df8fb4f9..0099fdd7 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.RecompileConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.RecompileConversation.g.cs @@ -76,6 +76,40 @@ partial void ProcessRecompileConversationResponseContent( public async global::System.Threading.Tasks.Task RecompileConversationAsync( string conversationId, + global::Letta.LettaServerRestApiRoutersV1ConversationsCompactionRequest request, + bool? dryRun = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RecompileConversationAsResponseAsync( + conversationId: conversationId, + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Recompile Conversation
+ /// Manually trigger system prompt recompilation for a conversation. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// If True, do not persist changes; still returns the compiled system prompt.
+ /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RecompileConversationAsResponseAsync( + string conversationId, + global::Letta.LettaServerRestApiRoutersV1ConversationsCompactionRequest request, bool? dryRun = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, @@ -113,13 +147,14 @@ partial void ProcessRecompileConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/recompile", baseUri: ResolveBaseUri( servers: s_RecompileConversationServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -199,6 +234,8 @@ partial void ProcessRecompileConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -209,6 +246,11 @@ partial void ProcessRecompileConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -226,6 +268,8 @@ partial void ProcessRecompileConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -235,8 +279,7 @@ partial void ProcessRecompileConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -245,6 +288,11 @@ partial void ProcessRecompileConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -261,14 +309,15 @@ partial void ProcessRecompileConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -308,6 +357,8 @@ partial void ProcessRecompileConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -328,6 +379,8 @@ partial void ProcessRecompileConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -390,7 +443,11 @@ partial void ProcessRecompileConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -418,7 +475,11 @@ partial void ProcessRecompileConversationResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversation.g.cs index 813df623..7f1bae27 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversation.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveConversationResponseContent( string conversationId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveConversationAsResponseAsync( + conversationId: conversationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Conversation
+ /// Retrieve a specific conversation. + ///
+ /// + /// The ID of the conv in the format 'conv-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveConversationAsResponseAsync( + string conversationId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveConversationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversationStream.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversationStream.g.cs index 8676fbbd..c5ec4305 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversationStream.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.RetrieveConversationStream.g.cs @@ -79,6 +79,43 @@ partial void ProcessRetrieveConversationStreamResponseContent( public async global::System.Threading.Tasks.Task RetrieveConversationStreamAsync( string conversationId, + global::Letta.RetrieveStreamRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveConversationStreamAsResponseAsync( + conversationId: conversationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Conversation Stream
+ /// Resume the stream for the most recent active run in a conversation.
+ /// This endpoint allows you to reconnect to an active background stream
+ /// for a conversation, enabling recovery from network interruptions.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id in request body
+ /// to retrieve the stream for the agent's most recent active run.
+ /// **Direct run access**: Pass run_id directly to skip run lookup entirely.
+ /// Useful for recovery from duplicate request 409 errors.
+ /// **OTID lookup**: Pass otid to look up the run_id from Redis.
+ /// Useful when you have the otid from a 409 error response.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveConversationStreamAsResponseAsync( + string conversationId, + global::Letta.RetrieveStreamRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -114,6 +151,7 @@ partial void ProcessRetrieveConversationStreamResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/stream", baseUri: ResolveBaseUri( @@ -196,6 +234,8 @@ partial void ProcessRetrieveConversationStreamResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +246,11 @@ partial void ProcessRetrieveConversationStreamResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -223,6 +268,8 @@ partial void ProcessRetrieveConversationStreamResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +279,7 @@ partial void ProcessRetrieveConversationStreamResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +288,11 @@ partial void ProcessRetrieveConversationStreamResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -258,14 +309,15 @@ partial void ProcessRetrieveConversationStreamResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -305,6 +357,8 @@ partial void ProcessRetrieveConversationStreamResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +379,8 @@ partial void ProcessRetrieveConversationStreamResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -387,7 +443,11 @@ partial void ProcessRetrieveConversationStreamResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -415,7 +475,11 @@ partial void ProcessRetrieveConversationStreamResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.SendConversationMessage.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.SendConversationMessage.g.cs index 118f5a44..6dae0666 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.SendConversationMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.SendConversationMessage.g.cs @@ -78,6 +78,40 @@ partial void ProcessSendConversationMessageResponseContent( public async global::System.Threading.Tasks.Task SendConversationMessageAsync( string conversationId, + global::Letta.ConversationMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SendConversationMessageAsResponseAsync( + conversationId: conversationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Send Conversation Message
+ /// Send a message to a conversation and get a response.
+ /// This endpoint sends a message to an existing conversation.
+ /// By default (streaming=true), returns a streaming response (Server-Sent Events).
+ /// Set streaming=false to get a complete JSON response.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id in request body
+ /// to send messages to the agent's default conversation with locking.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SendConversationMessageAsResponseAsync( + string conversationId, + global::Letta.ConversationMessageRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -113,6 +147,7 @@ partial void ProcessSendConversationMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}/messages", baseUri: ResolveBaseUri( @@ -195,6 +230,8 @@ partial void ProcessSendConversationMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -205,6 +242,11 @@ partial void ProcessSendConversationMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -222,6 +264,8 @@ partial void ProcessSendConversationMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -231,8 +275,7 @@ partial void ProcessSendConversationMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -241,6 +284,11 @@ partial void ProcessSendConversationMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -257,14 +305,15 @@ partial void ProcessSendConversationMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +353,8 @@ partial void ProcessSendConversationMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -324,6 +375,8 @@ partial void ProcessSendConversationMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -386,9 +439,13 @@ partial void ProcessSendConversationMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.LettaResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.LettaResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -416,9 +473,13 @@ partial void ProcessSendConversationMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.LettaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.LettaResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.UpdateConversation.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.UpdateConversation.g.cs index 838f7fcc..27418da4 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.UpdateConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.UpdateConversation.g.cs @@ -70,6 +70,34 @@ partial void ProcessUpdateConversationResponseContent( public async global::System.Threading.Tasks.Task UpdateConversationAsync( string conversationId, + global::Letta.UpdateConversation request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateConversationAsResponseAsync( + conversationId: conversationId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Conversation
+ /// Update a conversation. + ///
+ /// + /// The ID of the conv in the format 'conv-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpdateConversationAsResponseAsync( + string conversationId, + global::Letta.UpdateConversation request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessUpdateConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/conversations/{conversationId}", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessUpdateConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessUpdateConversationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessUpdateConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessUpdateConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessUpdateConversationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessUpdateConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessUpdateConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessUpdateConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessUpdateConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Conversation.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessUpdateConversationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Conversation.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ConversationsClient.g.cs b/src/libs/Letta/Generated/Letta.ConversationsClient.g.cs index 7b692cef..eb18e503 100644 --- a/src/libs/Letta/Generated/Letta.ConversationsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ConversationsClient.g.cs @@ -103,10 +103,10 @@ public ConversationsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ConversationsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.DeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs b/src/libs/Letta/Generated/Letta.DeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs index 2f20d846..e3b7a0a4 100644 --- a/src/libs/Letta/Generated/Letta.DeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs +++ b/src/libs/Letta/Generated/Letta.DeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( string deviceId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeviceStorageGetDeviceStorageKeyAsResponseAsync( + deviceId: deviceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Device Storage Key
+ /// Returns an HMAC-derived AES-256-GCM key scoped to the authenticated user and device. Used to encrypt/decrypt local IndexedDB caches on the client. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeviceStorageGetDeviceStorageKeyAsResponseAsync( + string deviceId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,13 +116,14 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/device-storage-key", baseUri: ResolveBaseUri( servers: s_DeviceStorageGetDeviceStorageKeyServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddRequiredParameter("deviceId", deviceId) + .AddRequiredParameter("deviceId", deviceId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -173,6 +195,8 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +207,11 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +229,8 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +240,7 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +249,11 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +270,15 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +318,8 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +340,8 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,9 +366,13 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.DeviceStorageGetDeviceStorageKeyResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.DeviceStorageGetDeviceStorageKeyResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -356,9 +400,13 @@ partial void ProcessDeviceStorageGetDeviceStorageKeyResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.DeviceStorageGetDeviceStorageKeyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.DeviceStorageGetDeviceStorageKeyResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.DeviceStorageClient.g.cs b/src/libs/Letta/Generated/Letta.DeviceStorageClient.g.cs index e974fd82..d844a8cd 100644 --- a/src/libs/Letta/Generated/Letta.DeviceStorageClient.g.cs +++ b/src/libs/Letta/Generated/Letta.DeviceStorageClient.g.cs @@ -103,10 +103,10 @@ public DeviceStorageClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DeviceStorageClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.EmbeddingsClient.GetTotalStorageSize.g.cs b/src/libs/Letta/Generated/Letta.EmbeddingsClient.GetTotalStorageSize.g.cs index e379ea3a..10cab28b 100644 --- a/src/libs/Letta/Generated/Letta.EmbeddingsClient.GetTotalStorageSize.g.cs +++ b/src/libs/Letta/Generated/Letta.EmbeddingsClient.GetTotalStorageSize.g.cs @@ -68,6 +68,29 @@ partial void ProcessGetTotalStorageSizeResponseContent( string? storageUnit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTotalStorageSizeAsResponseAsync( + storageUnit: storageUnit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Embeddings Total Storage Size
+ /// Get the total size of all embeddings in the database for a user in the storage unit given. + ///
+ /// + /// Default Value: GB + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetTotalStorageSizeAsResponseAsync( + string? storageUnit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessGetTotalStorageSizeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/embeddings/total_storage_size", baseUri: ResolveBaseUri( @@ -178,6 +202,8 @@ partial void ProcessGetTotalStorageSizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +214,11 @@ partial void ProcessGetTotalStorageSizeResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +236,8 @@ partial void ProcessGetTotalStorageSizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +247,7 @@ partial void ProcessGetTotalStorageSizeResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +256,11 @@ partial void ProcessGetTotalStorageSizeResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +277,15 @@ partial void ProcessGetTotalStorageSizeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +325,8 @@ partial void ProcessGetTotalStorageSizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +347,8 @@ partial void ProcessGetTotalStorageSizeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +411,13 @@ partial void ProcessGetTotalStorageSizeResponseContent( { __response.EnsureSuccessStatusCode(); - return - (double?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(double?), JsonSerializerContext) ?? + var __value = (double?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(double?), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -399,9 +445,13 @@ partial void ProcessGetTotalStorageSizeResponseContent( #endif ).ConfigureAwait(false); - return - (double?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(double?), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (double?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(double?), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.EmbeddingsClient.g.cs b/src/libs/Letta/Generated/Letta.EmbeddingsClient.g.cs index a6d932ee..49c3ceee 100644 --- a/src/libs/Letta/Generated/Letta.EmbeddingsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.EmbeddingsClient.g.cs @@ -103,10 +103,10 @@ public EmbeddingsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EmbeddingsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs index 9a07630e..84c861dd 100644 --- a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs +++ b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs @@ -68,6 +68,32 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( public async global::System.Threading.Tasks.Task EnvironmentsDeleteEnvironmentAsync( string id, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EnvironmentsDeleteEnvironmentAsResponseAsync( + id: id, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Environment
+ /// Removes environment from list of environments + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EnvironmentsDeleteEnvironmentAsResponseAsync( + string id, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/environments/{id}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 403 @@ -414,9 +459,13 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.EnvironmentsDeleteEnvironmentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.EnvironmentsDeleteEnvironmentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +493,13 @@ partial void ProcessEnvironmentsDeleteEnvironmentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.EnvironmentsDeleteEnvironmentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.EnvironmentsDeleteEnvironmentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsGetConnection.g.cs b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsGetConnection.g.cs index 0fa39e45..44d51aea 100644 --- a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsGetConnection.g.cs +++ b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsGetConnection.g.cs @@ -66,6 +66,27 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( string deviceId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EnvironmentsGetConnectionAsResponseAsync( + deviceId: deviceId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Environment Connection
+ /// Get a specific environment connection by deviceId + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EnvironmentsGetConnectionAsResponseAsync( + string deviceId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/environments/{deviceId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -361,9 +401,13 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.EnvironmentsGetConnectionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.EnvironmentsGetConnectionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessEnvironmentsGetConnectionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.EnvironmentsGetConnectionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.EnvironmentsGetConnectionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsListConnections.g.cs b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsListConnections.g.cs index 7a9bdd4c..f2ad22ac 100644 --- a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsListConnections.g.cs +++ b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsListConnections.g.cs @@ -78,6 +78,36 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( string? onlineOnly = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EnvironmentsListConnectionsAsResponseAsync( + limit: limit, + after: after, + userId: userId, + onlineOnly: onlineOnly, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Environment Connections
+ /// List all active environment connections for the organization + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EnvironmentsListConnectionsAsResponseAsync( + string? limit = default, + string? after = default, + string? userId = default, + string? onlineOnly = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,16 +140,17 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/environments", baseUri: ResolveBaseUri( servers: s_EnvironmentsListConnectionsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("limit", limit) .AddOptionalParameter("after", after) .AddOptionalParameter("userId", userId) - .AddOptionalParameter("onlineOnly", onlineOnly) + .AddOptionalParameter("onlineOnly", onlineOnly) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -194,6 +225,8 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +237,11 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +259,8 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +270,7 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +279,11 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +300,15 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +348,8 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +370,8 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -347,9 +396,13 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.EnvironmentsListConnectionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.EnvironmentsListConnectionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -377,9 +430,13 @@ partial void ProcessEnvironmentsListConnectionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.EnvironmentsListConnectionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.EnvironmentsListConnectionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsRegister.g.cs b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsRegister.g.cs index dc070dce..05de53ff 100644 --- a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsRegister.g.cs +++ b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsRegister.g.cs @@ -64,6 +64,29 @@ partial void ProcessEnvironmentsRegisterResponseContent( /// public async global::System.Threading.Tasks.Task EnvironmentsRegisterAsync( + global::Letta.EnvironmentsRegisterRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EnvironmentsRegisterAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Register Environment
+ /// Register a new listener connection and get connectionId for WebSocket + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EnvironmentsRegisterAsResponseAsync( + global::Letta.EnvironmentsRegisterRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessEnvironmentsRegisterResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/environments/register", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessEnvironmentsRegisterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessEnvironmentsRegisterResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessEnvironmentsRegisterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessEnvironmentsRegisterResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessEnvironmentsRegisterResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessEnvironmentsRegisterResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessEnvironmentsRegisterResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessEnvironmentsRegisterResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -370,9 +412,13 @@ partial void ProcessEnvironmentsRegisterResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.EnvironmentsRegisterResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.EnvironmentsRegisterResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessEnvironmentsRegisterResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.EnvironmentsRegisterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.EnvironmentsRegisterResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsSendMessage.g.cs b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsSendMessage.g.cs index 27810065..cfa51e4a 100644 --- a/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsSendMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.EnvironmentsClient.EnvironmentsSendMessage.g.cs @@ -68,6 +68,32 @@ partial void ProcessEnvironmentsSendMessageResponseContent( public async global::System.Threading.Tasks.Task EnvironmentsSendMessageAsync( string connectionId, + global::Letta.EnvironmentsSendMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EnvironmentsSendMessageAsResponseAsync( + connectionId: connectionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Send Message to Environment
+ /// Send a message to a specific environment connection + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> EnvironmentsSendMessageAsResponseAsync( + string connectionId, + global::Letta.EnvironmentsSendMessageRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessEnvironmentsSendMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/environments/{connectionId}/messages", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessEnvironmentsSendMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessEnvironmentsSendMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessEnvironmentsSendMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessEnvironmentsSendMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessEnvironmentsSendMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessEnvironmentsSendMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessEnvironmentsSendMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessEnvironmentsSendMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -452,9 +497,13 @@ partial void ProcessEnvironmentsSendMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.EnvironmentsSendMessageResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.EnvironmentsSendMessageResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -482,9 +531,13 @@ partial void ProcessEnvironmentsSendMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.EnvironmentsSendMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.EnvironmentsSendMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.EnvironmentsClient.g.cs b/src/libs/Letta/Generated/Letta.EnvironmentsClient.g.cs index 64bc04f9..6e52a4db 100644 --- a/src/libs/Letta/Generated/Letta.EnvironmentsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.EnvironmentsClient.g.cs @@ -103,10 +103,10 @@ public EnvironmentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EnvironmentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsBackfillSubscription.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsBackfillSubscription.g.cs index 8c0b1fe5..304555cb 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsBackfillSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsBackfillSubscription.g.cs @@ -72,6 +72,35 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( string feedId, string subscriptionId, + global::Letta.FeedsBackfillSubscriptionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsBackfillSubscriptionAsResponseAsync( + feedId: feedId, + subscriptionId: subscriptionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Backfill Subscription
+ /// Start a background job to send historical messages to an agent subscription. Returns immediately with workflow ID. Does not update last_consumed_sequence. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsBackfillSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + global::Letta.FeedsBackfillSubscriptionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions/{subscriptionId}/backfill", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -382,9 +430,13 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsBackfillSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsBackfillSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +464,13 @@ partial void ProcessFeedsBackfillSubscriptionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsBackfillSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsBackfillSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsCreateFeed.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsCreateFeed.g.cs index b1dc4ff5..c6ed9e91 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsCreateFeed.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsCreateFeed.g.cs @@ -64,6 +64,29 @@ partial void ProcessFeedsCreateFeedResponseContent( /// public async global::System.Threading.Tasks.Task FeedsCreateFeedAsync( + global::Letta.FeedsCreateFeedRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsCreateFeedAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Feed
+ /// Create a new feed in a project + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsCreateFeedAsResponseAsync( + global::Letta.FeedsCreateFeedRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessFeedsCreateFeedResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/feeds", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessFeedsCreateFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessFeedsCreateFeedResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessFeedsCreateFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessFeedsCreateFeedResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessFeedsCreateFeedResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessFeedsCreateFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessFeedsCreateFeedResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessFeedsCreateFeedResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessFeedsCreateFeedResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsCreateFeedResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsCreateFeedResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessFeedsCreateFeedResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsCreateFeedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsCreateFeedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteFeed.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteFeed.g.cs index 7fdafc42..b985837d 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteFeed.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteFeed.g.cs @@ -68,6 +68,32 @@ partial void ProcessFeedsDeleteFeedResponseContent( public async global::System.Threading.Tasks.Task FeedsDeleteFeedAsync( string feedId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsDeleteFeedAsResponseAsync( + feedId: feedId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Feed
+ /// Soft delete a feed and clean up its sequence + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsDeleteFeedAsResponseAsync( + string feedId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessFeedsDeleteFeedResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessFeedsDeleteFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessFeedsDeleteFeedResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessFeedsDeleteFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessFeedsDeleteFeedResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessFeedsDeleteFeedResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessFeedsDeleteFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessFeedsDeleteFeedResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessFeedsDeleteFeedResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessFeedsDeleteFeedResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsDeleteFeedResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsDeleteFeedResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessFeedsDeleteFeedResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsDeleteFeedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsDeleteFeedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteSubscription.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteSubscription.g.cs index 1496a16b..8acb8588 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsDeleteSubscription.g.cs @@ -72,6 +72,35 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( string feedId, string subscriptionId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsDeleteSubscriptionAsResponseAsync( + feedId: feedId, + subscriptionId: subscriptionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Subscription
+ /// Remove agent subscription from a feed (by subscription_id) + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsDeleteSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions/{subscriptionId}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsDeleteSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsDeleteSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessFeedsDeleteSubscriptionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsDeleteSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsDeleteSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetFeed.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetFeed.g.cs index a3ccb8aa..5e5d587d 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetFeed.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetFeed.g.cs @@ -66,6 +66,27 @@ partial void ProcessFeedsGetFeedResponseContent( string feedId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsGetFeedAsResponseAsync( + feedId: feedId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Feed
+ /// Retrieve feed details by ID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsGetFeedAsResponseAsync( + string feedId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessFeedsGetFeedResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessFeedsGetFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessFeedsGetFeedResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessFeedsGetFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessFeedsGetFeedResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessFeedsGetFeedResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessFeedsGetFeedResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessFeedsGetFeedResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessFeedsGetFeedResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +363,13 @@ partial void ProcessFeedsGetFeedResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsGetFeedResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsGetFeedResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -353,9 +397,13 @@ partial void ProcessFeedsGetFeedResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsGetFeedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsGetFeedResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetMessage.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetMessage.g.cs index 787fcda7..cdc55696 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsGetMessage.g.cs @@ -70,6 +70,30 @@ partial void ProcessFeedsGetMessageResponseContent( string messageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsGetMessageAsResponseAsync( + feedId: feedId, + messageId: messageId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Feed Message
+ /// Get full content of a feed message + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsGetMessageAsResponseAsync( + string feedId, + string messageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessFeedsGetMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/messages/{messageId}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessFeedsGetMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessFeedsGetMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessFeedsGetMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessFeedsGetMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessFeedsGetMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessFeedsGetMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessFeedsGetMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessFeedsGetMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -367,9 +410,13 @@ partial void ProcessFeedsGetMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsGetMessageResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsGetMessageResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,9 +444,13 @@ partial void ProcessFeedsGetMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsGetMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsGetMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListFeeds.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListFeeds.g.cs index a06feb31..c8dc3a02 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListFeeds.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListFeeds.g.cs @@ -78,6 +78,36 @@ partial void ProcessFeedsListFeedsResponseContent( global::Letta.OneOf? offset = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsListFeedsAsResponseAsync( + projectId: projectId, + name: name, + limit: limit, + offset: offset, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Feeds
+ /// List all feeds with optional filters and pagination + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsListFeedsAsResponseAsync( + string? projectId = default, + string? name = default, + string? limit = default, + global::Letta.OneOf? offset = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,16 +140,17 @@ partial void ProcessFeedsListFeedsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/feeds", baseUri: ResolveBaseUri( servers: s_FeedsListFeedsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("project_id", projectId) .AddOptionalParameter("name", name) .AddOptionalParameter("limit", limit) - .AddOptionalParameter("offset", offset?.ToString()) + .AddOptionalParameter("offset", offset?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -194,6 +225,8 @@ partial void ProcessFeedsListFeedsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -204,6 +237,11 @@ partial void ProcessFeedsListFeedsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -221,6 +259,8 @@ partial void ProcessFeedsListFeedsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -230,8 +270,7 @@ partial void ProcessFeedsListFeedsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -240,6 +279,11 @@ partial void ProcessFeedsListFeedsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -256,14 +300,15 @@ partial void ProcessFeedsListFeedsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -303,6 +348,8 @@ partial void ProcessFeedsListFeedsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -323,6 +370,8 @@ partial void ProcessFeedsListFeedsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -347,9 +396,13 @@ partial void ProcessFeedsListFeedsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsListFeedsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsListFeedsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -377,9 +430,13 @@ partial void ProcessFeedsListFeedsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsListFeedsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsListFeedsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListMessages.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListMessages.g.cs index 9810ee33..47f12fcc 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListMessages.g.cs @@ -74,6 +74,33 @@ partial void ProcessFeedsListMessagesResponseContent( string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsListMessagesAsResponseAsync( + feedId: feedId, + afterSequence: afterSequence, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Feed Messages
+ /// List messages from a feed (for debugging/inspection) + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsListMessagesAsResponseAsync( + string feedId, + string? afterSequence = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,14 +132,15 @@ partial void ProcessFeedsListMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/messages", baseUri: ResolveBaseUri( servers: s_FeedsListMessagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("after_sequence", afterSequence) - .AddOptionalParameter("limit", limit) + .AddOptionalParameter("limit", limit) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -186,6 +214,8 @@ partial void ProcessFeedsListMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessFeedsListMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessFeedsListMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessFeedsListMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessFeedsListMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessFeedsListMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessFeedsListMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessFeedsListMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -339,9 +385,13 @@ partial void ProcessFeedsListMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsListMessagesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsListMessagesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -369,9 +419,13 @@ partial void ProcessFeedsListMessagesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsListMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsListMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptionHistory.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptionHistory.g.cs index a1623c3a..2d87c074 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptionHistory.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptionHistory.g.cs @@ -78,6 +78,36 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( string? nextPageToken = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsListSubscriptionHistoryAsResponseAsync( + feedId: feedId, + subscriptionId: subscriptionId, + pageSize: pageSize, + nextPageToken: nextPageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Subscription History
+ /// List the run history for a subscription including scheduled runs, manual triggers, and backfills. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsListSubscriptionHistoryAsResponseAsync( + string feedId, + string subscriptionId, + string? pageSize = default, + string? nextPageToken = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,14 +140,15 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions/{subscriptionId}/history", baseUri: ResolveBaseUri( servers: s_FeedsListSubscriptionHistoryServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("page_size", pageSize) - .AddOptionalParameter("next_page_token", nextPageToken) + .AddOptionalParameter("next_page_token", nextPageToken) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -192,6 +223,8 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +235,11 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +257,8 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +268,7 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +277,11 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +298,15 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +346,8 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +368,8 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -383,9 +432,13 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsListSubscriptionHistoryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsListSubscriptionHistoryResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -413,9 +466,13 @@ partial void ProcessFeedsListSubscriptionHistoryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsListSubscriptionHistoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsListSubscriptionHistoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptions.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptions.g.cs index 75751d45..facfcc14 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptions.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsListSubscriptions.g.cs @@ -78,6 +78,36 @@ partial void ProcessFeedsListSubscriptionsResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsListSubscriptionsAsResponseAsync( + feedId: feedId, + limit: limit, + offset: offset, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Feed Subscriptions
+ /// List all agent subscriptions for a feed + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsListSubscriptionsAsResponseAsync( + string feedId, + string? limit = default, + global::Letta.OneOf? offset = default, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,15 +140,16 @@ partial void ProcessFeedsListSubscriptionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions", baseUri: ResolveBaseUri( servers: s_FeedsListSubscriptionsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("limit", limit) .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -193,6 +224,8 @@ partial void ProcessFeedsListSubscriptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +236,11 @@ partial void ProcessFeedsListSubscriptionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +258,8 @@ partial void ProcessFeedsListSubscriptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +269,7 @@ partial void ProcessFeedsListSubscriptionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +278,11 @@ partial void ProcessFeedsListSubscriptionsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +299,15 @@ partial void ProcessFeedsListSubscriptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +347,8 @@ partial void ProcessFeedsListSubscriptionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +369,8 @@ partial void ProcessFeedsListSubscriptionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -346,9 +395,13 @@ partial void ProcessFeedsListSubscriptionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsListSubscriptionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsListSubscriptionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -376,9 +429,13 @@ partial void ProcessFeedsListSubscriptionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsListSubscriptionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsListSubscriptionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsPublishMessages.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsPublishMessages.g.cs index fe80bb22..981e2dd4 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsPublishMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsPublishMessages.g.cs @@ -68,6 +68,32 @@ partial void ProcessFeedsPublishMessagesResponseContent( public async global::System.Threading.Tasks.Task FeedsPublishMessagesAsync( string feedId, + global::Letta.FeedsPublishMessagesRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsPublishMessagesAsResponseAsync( + feedId: feedId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Publish Messages
+ /// Batch insert messages into a feed (up to 10,000 per request) + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsPublishMessagesAsResponseAsync( + string feedId, + global::Letta.FeedsPublishMessagesRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessFeedsPublishMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/messages", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessFeedsPublishMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessFeedsPublishMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessFeedsPublishMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessFeedsPublishMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessFeedsPublishMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessFeedsPublishMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessFeedsPublishMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessFeedsPublishMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessFeedsPublishMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsPublishMessagesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsPublishMessagesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessFeedsPublishMessagesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsPublishMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsPublishMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsSubscribeAgent.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsSubscribeAgent.g.cs index 3bbe6d07..e0ff4a6d 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsSubscribeAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsSubscribeAgent.g.cs @@ -68,6 +68,32 @@ partial void ProcessFeedsSubscribeAgentResponseContent( public async global::System.Threading.Tasks.Task FeedsSubscribeAgentAsync( string feedId, + global::Letta.FeedsSubscribeAgentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsSubscribeAgentAsResponseAsync( + feedId: feedId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Subscribe Agent to Feed
+ /// Subscribe an agent to a feed with polling configuration + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsSubscribeAgentAsResponseAsync( + string feedId, + global::Letta.FeedsSubscribeAgentRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessFeedsSubscribeAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscribe", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessFeedsSubscribeAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessFeedsSubscribeAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessFeedsSubscribeAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessFeedsSubscribeAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessFeedsSubscribeAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessFeedsSubscribeAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessFeedsSubscribeAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessFeedsSubscribeAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -376,9 +421,13 @@ partial void ProcessFeedsSubscribeAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsSubscribeAgentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsSubscribeAgentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessFeedsSubscribeAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsSubscribeAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsSubscribeAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsTriggerSubscription.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsTriggerSubscription.g.cs index b92b3652..932fd75c 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsTriggerSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsTriggerSubscription.g.cs @@ -72,6 +72,35 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( string feedId, string subscriptionId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsTriggerSubscriptionAsResponseAsync( + feedId: feedId, + subscriptionId: subscriptionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Trigger Subscription
+ /// Immediately trigger a subscription to process pending messages + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsTriggerSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions/{subscriptionId}/trigger", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -382,9 +430,13 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsTriggerSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsTriggerSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +464,13 @@ partial void ProcessFeedsTriggerSubscriptionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsTriggerSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsTriggerSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUnsubscribeAgent.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUnsubscribeAgent.g.cs index fb18c27e..95df1695 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUnsubscribeAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUnsubscribeAgent.g.cs @@ -68,6 +68,32 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( public async global::System.Threading.Tasks.Task FeedsUnsubscribeAgentAsync( string feedId, + global::Letta.FeedsUnsubscribeAgentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsUnsubscribeAgentAsResponseAsync( + feedId: feedId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Unsubscribe Agent from Feed
+ /// Remove agent subscription from a feed (by agent_id) + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsUnsubscribeAgentAsResponseAsync( + string feedId, + global::Letta.FeedsUnsubscribeAgentRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/unsubscribe", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsUnsubscribeAgentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsUnsubscribeAgentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessFeedsUnsubscribeAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsUnsubscribeAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsUnsubscribeAgentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs index f5019cdc..bc94a4d2 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs @@ -68,6 +68,32 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( public async global::System.Threading.Tasks.Task FeedsUpdateAllSubscriptionsCronAsync( string feedId, + global::Letta.FeedsUpdateAllSubscriptionsCronRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsUpdateAllSubscriptionsCronAsResponseAsync( + feedId: feedId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update All Subscriptions Cron Schedule
+ /// Update the cron schedule for all subscriptions of a feed + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsUpdateAllSubscriptionsCronAsResponseAsync( + string feedId, + global::Letta.FeedsUpdateAllSubscriptionsCronRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions/cron", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -376,9 +421,13 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsUpdateAllSubscriptionsCronResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsUpdateAllSubscriptionsCronResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessFeedsUpdateAllSubscriptionsCronResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsUpdateAllSubscriptionsCronResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsUpdateAllSubscriptionsCronResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateSubscription.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateSubscription.g.cs index a8dbf857..a230bf41 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.FeedsUpdateSubscription.g.cs @@ -72,6 +72,35 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( string feedId, string subscriptionId, + global::Letta.FeedsUpdateSubscriptionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FeedsUpdateSubscriptionAsResponseAsync( + feedId: feedId, + subscriptionId: subscriptionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Subscription
+ /// Update subscription configuration (cron schedule, enable/disable) + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> FeedsUpdateSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + global::Letta.FeedsUpdateSubscriptionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/feeds/{feedId}/subscriptions/{subscriptionId}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FeedsUpdateSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FeedsUpdateSubscriptionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessFeedsUpdateSubscriptionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FeedsUpdateSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FeedsUpdateSubscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FeedsClient.g.cs b/src/libs/Letta/Generated/Letta.FeedsClient.g.cs index ab45ab2f..0613867f 100644 --- a/src/libs/Letta/Generated/Letta.FeedsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.FeedsClient.g.cs @@ -103,10 +103,10 @@ public FeedsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FeedsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.CountFolders.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.CountFolders.g.cs index eb17f7d9..4fd9b4ce 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.CountFolders.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.CountFolders.g.cs @@ -62,6 +62,24 @@ partial void ProcessCountFoldersResponseContent( public async global::System.Threading.Tasks.Task CountFoldersAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CountFoldersAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Folders
+ /// Count all data folders created by a user. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CountFoldersAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessCountFoldersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/folders/count", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessCountFoldersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessCountFoldersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessCountFoldersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessCountFoldersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessCountFoldersResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessCountFoldersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessCountFoldersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessCountFoldersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -355,9 +392,13 @@ partial void ProcessCountFoldersResponseContent( { __response.EnsureSuccessStatusCode(); - return - (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? + var __value = (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -385,9 +426,13 @@ partial void ProcessCountFoldersResponseContent( #endif ).ConfigureAwait(false); - return - (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.CreateFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.CreateFolder.g.cs index e5faa48c..44fd39e6 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.CreateFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.CreateFolder.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateFolderResponseContent( /// public async global::System.Threading.Tasks.Task CreateFolderAsync( + global::Letta.SourceCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateFolderAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Folder
+ /// Create a new data folder. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateFolderAsResponseAsync( + global::Letta.SourceCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateFolderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/folders/", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateFolderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateFolderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateFolderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessCreateFolderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Folder.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Folder.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateFolderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Folder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Folder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFileFromFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFileFromFolder.g.cs index 9ddf7430..339ff147 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFileFromFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFileFromFolder.g.cs @@ -69,6 +69,32 @@ partial void ProcessDeleteFileFromFolderResponse( string fileId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteFileFromFolderAsResponseAsync( + folderId: folderId, + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete File From Folder
+ /// Delete a file from a folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteFileFromFolderAsResponseAsync( + string folderId, + string fileId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -99,6 +125,7 @@ partial void ProcessDeleteFileFromFolderResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}/{fileId}", baseUri: ResolveBaseUri( @@ -175,6 +202,8 @@ partial void ProcessDeleteFileFromFolderResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +214,11 @@ partial void ProcessDeleteFileFromFolderResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -202,6 +236,8 @@ partial void ProcessDeleteFileFromFolderResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -211,8 +247,7 @@ partial void ProcessDeleteFileFromFolderResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -221,6 +256,11 @@ partial void ProcessDeleteFileFromFolderResponse( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -237,14 +277,15 @@ partial void ProcessDeleteFileFromFolderResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +325,8 @@ partial void ProcessDeleteFileFromFolderResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +347,8 @@ partial void ProcessDeleteFileFromFolderResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,6 +407,10 @@ partial void ProcessDeleteFileFromFolderResponse( { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -383,6 +432,10 @@ partial void ProcessDeleteFileFromFolderResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFolder.g.cs index e5f4f671..83823480 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.DeleteFolder.g.cs @@ -68,6 +68,29 @@ partial void ProcessDeleteFolderResponseContent( string folderId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteFolderAsResponseAsync( + folderId: folderId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Folder
+ /// Delete a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteFolderAsResponseAsync( + string folderId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessDeleteFolderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessDeleteFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessDeleteFolderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessDeleteFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessDeleteFolderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessDeleteFolderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessDeleteFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessDeleteFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessDeleteFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,7 +405,11 @@ partial void ProcessDeleteFolderResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -391,7 +437,11 @@ partial void ProcessDeleteFolderResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.ListAgentsForFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.ListAgentsForFolder.g.cs index eb5f9687..c73b79a6 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.ListAgentsForFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.ListAgentsForFolder.g.cs @@ -101,6 +101,57 @@ partial void ProcessListAgentsForFolderResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsForFolderAsResponseAsync( + folderId: folderId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents For Folder
+ /// Get all agent IDs that have the specified folder attached. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsForFolderAsResponseAsync( + string folderId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForFolderOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListAgentsForFolderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}/agents", baseUri: ResolveBaseUri( servers: s_ListAgentsForFolderServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListAgentsForFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListAgentsForFolderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListAgentsForFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListAgentsForFolderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListAgentsForFolderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListAgentsForFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListAgentsForFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListAgentsForFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListAgentsForFolderResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListAgentsForFolderResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.ListFilesForFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.ListFilesForFolder.g.cs index ce4f8d73..bf94f131 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.ListFilesForFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.ListFilesForFolder.g.cs @@ -108,6 +108,63 @@ partial void ProcessListFilesForFolderResponseContent( bool? includeContent = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFilesForFolderAsResponseAsync( + folderId: folderId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + includeContent: includeContent, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Files For Folder
+ /// List paginated files associated with a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// File ID cursor for pagination. Returns files that come before this file ID in the specified sort order + /// + /// + /// File ID cursor for pagination. Returns files that come after this file ID in the specified sort order + /// + /// + /// Maximum number of files to return
+ /// Default Value: 1000 + /// + /// + /// Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Whether to include full file content
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListFilesForFolderAsResponseAsync( + string folderId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFilesForFolderOrder? order = default, + string? orderBy = default, + bool? includeContent = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -143,18 +200,19 @@ partial void ProcessListFilesForFolderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}/files", baseUri: ResolveBaseUri( servers: s_ListFilesForFolderServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) - .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +290,8 @@ partial void ProcessListFilesForFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -242,6 +302,11 @@ partial void ProcessListFilesForFolderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -259,6 +324,8 @@ partial void ProcessListFilesForFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -268,8 +335,7 @@ partial void ProcessListFilesForFolderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +344,11 @@ partial void ProcessListFilesForFolderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -294,14 +365,15 @@ partial void ProcessListFilesForFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -341,6 +413,8 @@ partial void ProcessListFilesForFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -361,6 +435,8 @@ partial void ProcessListFilesForFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -423,9 +499,13 @@ partial void ProcessListFilesForFolderResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -453,9 +533,13 @@ partial void ProcessListFilesForFolderResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.ListFolderPassages.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.ListFolderPassages.g.cs index c37e2069..3bd65fba 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.ListFolderPassages.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.ListFolderPassages.g.cs @@ -101,6 +101,57 @@ partial void ProcessListFolderPassagesResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFolderPassagesAsResponseAsync( + folderId: folderId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Folder Passages
+ /// List all passages associated with a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// Passage ID cursor for pagination. Returns passages that come before this passage ID in the specified sort order + /// + /// + /// Passage ID cursor for pagination. Returns passages that come after this passage ID in the specified sort order + /// + /// + /// Maximum number of passages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for passages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListFolderPassagesAsResponseAsync( + string folderId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFolderPassagesOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListFolderPassagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}/passages", baseUri: ResolveBaseUri( servers: s_ListFolderPassagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListFolderPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListFolderPassagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListFolderPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListFolderPassagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListFolderPassagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListFolderPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListFolderPassagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListFolderPassagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListFolderPassagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListFolderPassagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.ListFolders.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.ListFolders.g.cs index 9c97327f..ac0c481e 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.ListFolders.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.ListFolders.g.cs @@ -101,6 +101,57 @@ partial void ProcessListFoldersResponseContent( string? name = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFoldersAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Folders
+ /// List all data folders created by a user. + ///
+ /// + /// Folder ID cursor for pagination. Returns folders that come before this folder ID in the specified sort order + /// + /// + /// Folder ID cursor for pagination. Returns folders that come after this folder ID in the specified sort order + /// + /// + /// Maximum number of folders to return
+ /// Default Value: 50 + /// + /// + /// Sort order for folders by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Folder name to filter by + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListFoldersAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFoldersOrder? order = default, + string? orderBy = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,18 +186,19 @@ partial void ProcessListFoldersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/folders/", baseUri: ResolveBaseUri( servers: s_ListFoldersServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) - .AddOptionalParameter("name", name) + .AddOptionalParameter("name", name) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -223,6 +275,8 @@ partial void ProcessListFoldersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -233,6 +287,11 @@ partial void ProcessListFoldersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -250,6 +309,8 @@ partial void ProcessListFoldersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -259,8 +320,7 @@ partial void ProcessListFoldersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -269,6 +329,11 @@ partial void ProcessListFoldersResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -285,14 +350,15 @@ partial void ProcessListFoldersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -332,6 +398,8 @@ partial void ProcessListFoldersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -352,6 +420,8 @@ partial void ProcessListFoldersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -414,9 +484,13 @@ partial void ProcessListFoldersResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +518,13 @@ partial void ProcessListFoldersResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.ModifyFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.ModifyFolder.g.cs index 81b83afd..fc32b371 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.ModifyFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.ModifyFolder.g.cs @@ -70,6 +70,34 @@ partial void ProcessModifyFolderResponseContent( public async global::System.Threading.Tasks.Task ModifyFolderAsync( string folderId, + global::Letta.SourceUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyFolderAsResponseAsync( + folderId: folderId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Folder
+ /// Update the name or documentation of an existing data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyFolderAsResponseAsync( + string folderId, + global::Letta.SourceUpdate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessModifyFolderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessModifyFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessModifyFolderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessModifyFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessModifyFolderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessModifyFolderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessModifyFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessModifyFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessModifyFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessModifyFolderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Folder.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Folder.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessModifyFolderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Folder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Folder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFile.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFile.g.cs index f772d7ef..fa7965b8 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFile.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFile.g.cs @@ -81,6 +81,40 @@ partial void ProcessRetrieveFileResponseContent( bool? includeContent = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveFileAsResponseAsync( + folderId: folderId, + fileId: fileId, + includeContent: includeContent, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve File
+ /// Retrieve a file from a folder by ID. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// + /// Whether to include full file content
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveFileAsResponseAsync( + string folderId, + string fileId, + bool? includeContent = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,13 +146,14 @@ partial void ProcessRetrieveFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}/files/{fileId}", baseUri: ResolveBaseUri( servers: s_RetrieveFileServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_content", includeContent?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -192,6 +227,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +239,11 @@ partial void ProcessRetrieveFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +261,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +272,7 @@ partial void ProcessRetrieveFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +281,11 @@ partial void ProcessRetrieveFileResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +302,15 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +350,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +372,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -383,9 +436,13 @@ partial void ProcessRetrieveFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.FileMetadata.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FileMetadata.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -413,9 +470,13 @@ partial void ProcessRetrieveFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.FileMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FileMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFolder.g.cs index 21245245..0170b881 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveFolder.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveFolderResponseContent( string folderId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveFolderAsResponseAsync( + folderId: folderId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Folder
+ /// Get a folder by ID + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveFolderAsResponseAsync( + string folderId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveFolderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveFolderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveFolderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveFolderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveFolderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveFolderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveFolderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Folder.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Folder.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveFolderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Folder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Folder.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveMetadata.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveMetadata.g.cs index cd410b5c..12059dbc 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveMetadata.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.RetrieveMetadata.g.cs @@ -73,6 +73,34 @@ partial void ProcessRetrieveMetadataResponseContent( bool? includeDetailedPerSourceMetadata = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveMetadataAsResponseAsync( + includeDetailedPerSourceMetadata: includeDetailedPerSourceMetadata, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Metadata
+ /// Get aggregated metadata for all folders in an organization.
+ /// Returns structured metadata including:
+ /// - Total number of folders
+ /// - Total number of files across all folders
+ /// - Total size of all files
+ /// - Per-source breakdown with file details (file_name, file_size per file) if include_detailed_per_source_metadata is True + ///
+ /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveMetadataAsResponseAsync( + bool? includeDetailedPerSourceMetadata = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -102,13 +130,14 @@ partial void ProcessRetrieveMetadataResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/folders/metadata", baseUri: ResolveBaseUri( servers: s_RetrieveMetadataServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("include_detailed_per_source_metadata", includeDetailedPerSourceMetadata?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_detailed_per_source_metadata", includeDetailedPerSourceMetadata?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -180,6 +209,8 @@ partial void ProcessRetrieveMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +221,11 @@ partial void ProcessRetrieveMetadataResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +243,8 @@ partial void ProcessRetrieveMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +254,7 @@ partial void ProcessRetrieveMetadataResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +263,11 @@ partial void ProcessRetrieveMetadataResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +284,15 @@ partial void ProcessRetrieveMetadataResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +332,8 @@ partial void ProcessRetrieveMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +354,8 @@ partial void ProcessRetrieveMetadataResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -371,9 +418,13 @@ partial void ProcessRetrieveMetadataResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.OrganizationSourcesStats.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.OrganizationSourcesStats.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -401,9 +452,13 @@ partial void ProcessRetrieveMetadataResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.OrganizationSourcesStats.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.OrganizationSourcesStats.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.UploadFileToFolder.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.UploadFileToFolder.g.cs index 4bbee211..40903048 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.UploadFileToFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.UploadFileToFolder.g.cs @@ -81,6 +81,45 @@ partial void ProcessUploadFileToFolderResponseContent( public async global::System.Threading.Tasks.Task UploadFileToFolderAsync( string folderId, + global::Letta.BodyUploadFileToFolder request, + global::Letta.DuplicateFileHandling? duplicateHandling = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadFileToFolderAsResponseAsync( + folderId: folderId, + + request: request, + duplicateHandling: duplicateHandling, + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload File To Folder
+ /// Upload a file to a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// How to handle duplicate filenames
+ /// Default Value: suffix + /// + /// + /// Optional custom name to override the uploaded file's name + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadFileToFolderAsResponseAsync( + string folderId, + global::Letta.BodyUploadFileToFolder request, global::Letta.DuplicateFileHandling? duplicateHandling = default, string? name = default, @@ -116,18 +155,19 @@ partial void ProcessUploadFileToFolderResponseContent( var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( clientOptions: Options, requestOptions: requestOptions, - supportsRetry: true); + supportsRetry: false); global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/folders/{folderId}/upload", baseUri: ResolveBaseUri( servers: s_UploadFileToFolderServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("duplicate_handling", duplicateHandling?.ToValueString()) - .AddOptionalParameter("name", name) + .AddOptionalParameter("name", name) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -158,23 +198,27 @@ partial void ProcessUploadFileToFolderResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(folderId ?? string.Empty), name: "\"folder_id\""); + if (duplicateHandling != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((duplicateHandling).HasValue ? (duplicateHandling).GetValueOrDefault().ToValueString() : string.Empty), name: "\"duplicate_handling\""); - } + + } if (name != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(name ?? string.Empty), name: "\"name\""); + } var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -213,7 +257,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -258,6 +304,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -268,6 +316,11 @@ request.Filename is null } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -285,6 +338,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -294,8 +349,7 @@ request.Filename is null __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -304,6 +358,11 @@ request.Filename is null __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -320,14 +379,15 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -367,6 +427,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -387,6 +449,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -449,9 +513,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Letta.FileMetadata.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.FileMetadata.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -479,9 +547,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Letta.FileMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.FileMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -561,5 +633,998 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload File To Folder
+ /// Upload a file to a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// How to handle duplicate filenames
+ /// Default Value: suffix + /// + /// + /// Optional custom name to override the uploaded file's name + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UploadFileToFolderAsync( + string folderId, + global::System.IO.Stream file, + string filename, + global::Letta.DuplicateFileHandling? duplicateHandling = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Letta.BodyUploadFileToFolder + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadFileToFolderArguments( + httpClient: HttpClient, + folderId: ref folderId, + duplicateHandling: ref duplicateHandling, + name: ref name, + request: request); + + + var __authorizations = global::Letta.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadFileToFolderSecurityRequirements, + operationName: "UploadFileToFolderAsync"); + + using var __timeoutCancellationTokenSource = global::Letta.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Letta.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Letta.PathBuilder( + path: $"/v1/folders/{folderId}/upload", + baseUri: ResolveBaseUri( + servers: s_UploadFileToFolderServers, + defaultBaseUrl: "https://app.letta.com/")); + __pathBuilder + .AddOptionalParameter("duplicate_handling", duplicateHandling?.ToValueString()) + .AddOptionalParameter("name", name) + ; + var __path = __pathBuilder.ToString(); + __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(folderId ?? string.Empty), + name: "\"folder_id\""); + + if (duplicateHandling != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((duplicateHandling).HasValue ? (duplicateHandling).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"duplicate_handling\""); + + } + if (name != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(name ?? string.Empty), + name: "\"name\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadFileToFolderRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + folderId: folderId!, + duplicateHandling: duplicateHandling, + name: name, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Letta.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadFileToFolderResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Letta.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Letta.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadFileToFolderResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Letta.FileMetadata.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::Letta.FileMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Upload File To Folder
+ /// Upload a file to a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// How to handle duplicate filenames
+ /// Default Value: suffix + /// + /// + /// Optional custom name to override the uploaded file's name + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UploadFileToFolderAsResponseAsync( + string folderId, + global::System.IO.Stream file, + string filename, + global::Letta.DuplicateFileHandling? duplicateHandling = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::Letta.BodyUploadFileToFolder + { + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadFileToFolderArguments( + httpClient: HttpClient, + folderId: ref folderId, + duplicateHandling: ref duplicateHandling, + name: ref name, + request: request); + + + var __authorizations = global::Letta.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadFileToFolderSecurityRequirements, + operationName: "UploadFileToFolderAsync"); + + using var __timeoutCancellationTokenSource = global::Letta.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Letta.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Letta.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Letta.PathBuilder( + path: $"/v1/folders/{folderId}/upload", + baseUri: ResolveBaseUri( + servers: s_UploadFileToFolderServers, + defaultBaseUrl: "https://app.letta.com/")); + __pathBuilder + .AddOptionalParameter("duplicate_handling", duplicateHandling?.ToValueString()) + .AddOptionalParameter("name", name) + ; + var __path = __pathBuilder.ToString(); + __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(folderId ?? string.Empty), + name: "\"folder_id\""); + + if (duplicateHandling != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((duplicateHandling).HasValue ? (duplicateHandling).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"duplicate_handling\""); + + } + if (name != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(name ?? string.Empty), + name: "\"name\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequest.Content = __httpRequestContent; + + global::Letta.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUploadFileToFolderRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + folderId: folderId!, + duplicateHandling: duplicateHandling, + name: name, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Letta.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUploadFileToFolderResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFileToFolder", + methodName: "UploadFileToFolderAsync", + pathTemplate: "$\"/v1/folders/{folderId}/upload\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::Letta.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::Letta.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + throw new global::Letta.ApiException( + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + statusCode: __response.StatusCode) + { + ResponseBody = __content_422, + ResponseObject = __value_422, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUploadFileToFolderResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Letta.FileMetadata.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Letta.FileMetadata.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::Letta.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.FoldersClient.g.cs b/src/libs/Letta/Generated/Letta.FoldersClient.g.cs index a3a22297..71ec7f22 100644 --- a/src/libs/Letta/Generated/Letta.FoldersClient.g.cs +++ b/src/libs/Letta/Generated/Letta.FoldersClient.g.cs @@ -103,10 +103,10 @@ public FoldersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FoldersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.HealthClient.CheckHealth.g.cs b/src/libs/Letta/Generated/Letta.HealthClient.CheckHealth.g.cs index 14fd301e..ecdf90f7 100644 --- a/src/libs/Letta/Generated/Letta.HealthClient.CheckHealth.g.cs +++ b/src/libs/Letta/Generated/Letta.HealthClient.CheckHealth.g.cs @@ -62,6 +62,24 @@ partial void ProcessCheckHealthResponseContent( public async global::System.Threading.Tasks.Task CheckHealthAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CheckHealthAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Check Health
+ /// Liveness endpoint; returns 200 when process is responsive. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CheckHealthAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessCheckHealthResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/health/", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessCheckHealthResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessCheckHealthResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessCheckHealthResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessCheckHealthResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessCheckHealthResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessCheckHealthResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessCheckHealthResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessCheckHealthResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessCheckHealthResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Health.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Health.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessCheckHealthResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Health.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Health.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.HealthClient.CheckReadiness.g.cs b/src/libs/Letta/Generated/Letta.HealthClient.CheckReadiness.g.cs index 1b221e78..d009c487 100644 --- a/src/libs/Letta/Generated/Letta.HealthClient.CheckReadiness.g.cs +++ b/src/libs/Letta/Generated/Letta.HealthClient.CheckReadiness.g.cs @@ -62,6 +62,24 @@ partial void ProcessCheckReadinessResponseContent( public async global::System.Threading.Tasks.Task CheckReadinessAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CheckReadinessAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Check Readiness
+ /// Readiness endpoint gated by internal readiness state when enforcement is enabled. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CheckReadinessAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessCheckReadinessResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/ready/", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessCheckReadinessResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessCheckReadinessResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessCheckReadinessResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessCheckReadinessResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessCheckReadinessResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessCheckReadinessResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessCheckReadinessResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessCheckReadinessResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessCheckReadinessResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Health.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Health.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessCheckReadinessResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Health.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Health.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.HealthClient.g.cs b/src/libs/Letta/Generated/Letta.HealthClient.g.cs index eabcbb3c..c551b2a2 100644 --- a/src/libs/Letta/Generated/Letta.HealthClient.g.cs +++ b/src/libs/Letta/Generated/Letta.HealthClient.g.cs @@ -103,10 +103,10 @@ public HealthClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public HealthClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsCountDeployedAgents.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsCountDeployedAgents.g.cs index c0986178..68232309 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsCountDeployedAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsCountDeployedAgents.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient global::Letta.AgentsCountDeployedAgentsCombinator? combinator = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Deployed Agents
+ /// Count deployed agents matching search criteria + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsCountDeployedAgentsAsResponseAsync( + global::System.Collections.Generic.IList>? search = default, + string? projectId = default, + global::Letta.AgentsCountDeployedAgentsCombinator? combinator = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsGetAgentVariables.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsGetAgentVariables.g.cs index 9c983672..3a2dec23 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsGetAgentVariables.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsGetAgentVariables.g.cs @@ -16,5 +16,17 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Memory Variables
+ /// Get the variables associated with an agent + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsGetAgentVariablesAsResponseAsync( + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsSearchDeployedAgents.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsSearchDeployedAgents.g.cs index e1ded2f2..87e2de17 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsSearchDeployedAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AgentsSearchDeployedAgents.g.cs @@ -21,6 +21,19 @@ public partial interface IAgentsClient /// Search Deployed Agents
/// Search deployed agents /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsSearchDeployedAgentsAsResponseAsync( + + global::Letta.AgentsSearchDeployedAgentsRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search Deployed Agents
+ /// Search deployed agents + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachArchiveToAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachArchiveToAgent.g.cs index d70c9b44..56cd1f96 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachArchiveToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachArchiveToAgent.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach Archive To Agent
+ /// Attach an archive to an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachArchiveToAgentAsResponseAsync( + string archiveId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachCoreMemoryBlock.g.cs index 6fbf08f0..7b71becf 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachCoreMemoryBlock.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach Block To Agent
+ /// Attach a core memory block to an agent. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachCoreMemoryBlockAsResponseAsync( + string blockId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachFolderToAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachFolderToAgent.g.cs index 4e12f693..b3f450ba 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachFolderToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachFolderToAgent.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach Folder To Agent
+ /// Attach a folder to an agent. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachFolderToAgentAsResponseAsync( + string folderId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachIdentityToAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachIdentityToAgent.g.cs index f12af719..61e1a028 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachIdentityToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachIdentityToAgent.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach Identity To Agent
+ /// Attach an identity to an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachIdentityToAgentAsResponseAsync( + string identityId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachToolToAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachToolToAgent.g.cs index c8736040..ff57f700 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.AttachToolToAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.AttachToolToAgent.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach Tool To Agent
+ /// Attach a tool to an agent. + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachToolToAgentAsResponseAsync( + string toolId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CancelMessage.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CancelMessage.g.cs index 7cb056c1..d2647149 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CancelMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CancelMessage.g.cs @@ -30,6 +30,24 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelMessageAsResponseAsync( + string agentId, + + global::Letta.CancelAgentRunRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel Message
+ /// Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
+ /// Note to cancel active runs associated with an agent, redis is required. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// Optional list of run IDs to cancel /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CloseAllFilesForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CloseAllFilesForAgent.g.cs index 795a8e9e..56e70142 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CloseAllFilesForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CloseAllFilesForAgent.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Close All Files For Agent
+ /// Closes all currently open files for a given agent.
+ /// This endpoint updates the file state for the agent so that no files are marked as open.
+ /// Typically used to reset the working memory view for the agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> CloseAllFilesForAgentAsResponseAsync( + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CloseFileForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CloseFileForAgent.g.cs index afd45a16..b3d4ed84 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CloseFileForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CloseFileForAgent.g.cs @@ -24,5 +24,25 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Close File For Agent
+ /// Closes a specific file for a given agent.
+ /// This endpoint marks a specific file as closed in the agent's file state.
+ /// The file will be removed from the agent's working memory view. + ///
+ /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CloseFileForAgentAsResponseAsync( + string fileId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CountAgents.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CountAgents.g.cs index 34ce585b..90dec018 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CountAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CountAgents.g.cs @@ -60,5 +60,61 @@ public partial interface IAgentsClient string? createdById = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Agents
+ /// Get the total number of agents with optional filtering.
+ /// Supports the same filters as list_agents for consistent querying. + ///
+ /// + /// Name of the agent + /// + /// + /// List of tags to filter agents by + /// + /// + /// If True, only counts agents that match ALL given tags. Otherwise, counts agents that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Search agents by name + /// + /// + /// Search agents by project ID - this will default to your default project on cloud + /// + /// + /// Search agents by template ID + /// + /// + /// Search agents by base template ID + /// + /// + /// Search agents by identity ID + /// + /// + /// Search agents by identifier keys + /// + /// + /// Filter agents by their last stop reason. + /// + /// + /// Filter agents by the user who created them. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CountAgentsAsResponseAsync( + string? name = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + string? queryText = default, + string? projectId = default, + string? templateId = default, + string? baseTemplateId = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + global::Letta.StopReasonType? lastStopReason = default, + string? createdById = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgent.g.cs index 21b8d687..5a56baea 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgent.g.cs @@ -30,6 +30,23 @@ public partial interface IAgentsClient /// /// The project slug to associate with the agent (cloud only). /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentAsResponseAsync( + + global::Letta.CreateAgentRequest request, + string? xProject = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agent
+ /// Create an agent. + ///
+ /// + /// The project slug to associate with the agent (cloud only). + /// /// /// The name of the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgentMessageAsync.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgentMessageAsync.g.cs index 1b22c87d..03218f30 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgentMessageAsync.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CreateAgentMessageAsync.g.cs @@ -40,6 +40,28 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateAgentMessageAsyncAsResponseAsync( + string agentId, + + global::Letta.LettaAsyncRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Send Message Async
+ /// Asynchronously process a user message and return a run object.
+ /// The actual processing happens in the background, and the status can be checked using the run ID.
+ /// This is "asynchronous" in the sense that it's a background run and explicitly must be fetched by the run ID.
+ /// **Note:** Sending multiple concurrent requests to the same agent can lead to undefined behavior.
+ /// Each agent processes messages sequentially, and concurrent requests may interleave in unexpected ways.
+ /// Wait for each request to complete before sending the next one. Use separate agents or conversations for parallel processing. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// The messages to be sent to the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.CreatePassage.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.CreatePassage.g.cs index 73a7940f..d4181a55 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.CreatePassage.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.CreatePassage.g.cs @@ -28,6 +28,23 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> CreatePassageAsResponseAsync( + string agentId, + + global::Letta.CreateArchivalMemory request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Passage
+ /// Insert a memory into an agent's archival memory store. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// Text to write to archival memory. /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DeleteAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DeleteAgent.g.cs index 33274fae..5eba938e 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DeleteAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DeleteAgent.g.cs @@ -18,5 +18,19 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Agent
+ /// Delete an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteAgentAsResponseAsync( + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DeletePassage.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DeletePassage.g.cs index 465460b9..c36024b7 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DeletePassage.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DeletePassage.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Passage
+ /// Delete a memory from an agent's archival memory store. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeletePassageAsResponseAsync( + string memoryId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachArchiveFromAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachArchiveFromAgent.g.cs index f9de9174..cd971167 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachArchiveFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachArchiveFromAgent.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach Archive From Agent
+ /// Detach an archive from an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachArchiveFromAgentAsResponseAsync( + string archiveId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachCoreMemoryBlock.g.cs index 5dcc9c1d..029f826a 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachCoreMemoryBlock.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach Block From Agent
+ /// Detach a core memory block from an agent. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachCoreMemoryBlockAsResponseAsync( + string blockId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachFolderFromAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachFolderFromAgent.g.cs index 2f3307f4..67c26901 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachFolderFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachFolderFromAgent.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach Folder From Agent
+ /// Detach a folder from an agent. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachFolderFromAgentAsResponseAsync( + string folderId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachIdentityFromAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachIdentityFromAgent.g.cs index acccd0f3..555587b0 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachIdentityFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachIdentityFromAgent.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach Identity From Agent
+ /// Detach an identity from an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachIdentityFromAgentAsResponseAsync( + string identityId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachToolFromAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachToolFromAgent.g.cs index 76585a81..a4b15855 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.DetachToolFromAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.DetachToolFromAgent.g.cs @@ -22,5 +22,23 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach Tool From Agent
+ /// Detach a tool from an agent. + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachToolFromAgentAsResponseAsync( + string toolId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgent.g.cs index 80c2eb14..fb1bf0ef 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgent.g.cs @@ -58,6 +58,39 @@ public partial interface IAgentsClient /// If True, excludes all messages from the export. Useful for sharing agent configs without conversation history.
/// Default Value: false /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ExportAgentAsResponseAsync( + string agentId, + + global::Letta.BodyExportAgent request, + int? maxSteps = default, + bool? useLegacyFormat = default, + string? conversationId = default, + bool? scrubMessages = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Export Agent
+ /// Export the serialized JSON representation of an agent, formatted with indentation. + ///
+ /// + /// + /// Default Value: 100 + /// + /// + /// If True, exports using the legacy single-agent 'v1' format with inline tools/blocks. If False, exports using the new multi-entity 'v2' format, with separate agents, tools, blocks, files, etc.
+ /// Default Value: false + /// + /// + /// Conversation ID to export. If provided, uses messages from this conversation instead of the agent's global message history. + /// + /// + /// If True, excludes all messages from the export. Useful for sharing agent configs without conversation history.
+ /// Default Value: false + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgentWithSkills.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgentWithSkills.g.cs index 8fde1101..3210a181 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgentWithSkills.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ExportAgentWithSkills.g.cs @@ -28,6 +28,23 @@ public partial interface IAgentsClient /// Skills are resolved client-side and passed as SkillSchema objects containing the skill files. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ExportAgentWithSkillsAsResponseAsync( + string agentId, + + global::Letta.ExportAgentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Export Agent With Skills
+ /// Export the serialized JSON representation of an agent with optional skills.
+ /// This POST endpoint allows including skills in the export by providing them in the request body.
+ /// Skills are resolved client-side and passed as SkillSchema objects containing the skill files. + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.GenerateCompletion.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.GenerateCompletion.g.cs index 243a8e0c..0535d799 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.GenerateCompletion.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.GenerateCompletion.g.cs @@ -58,6 +58,38 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GenerateCompletionAsResponseAsync( + string agentId, + + global::Letta.GenerateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Generate Completion
+ /// Generate a completion directly from the LLM provider using the agent's configuration.
+ /// This endpoint makes a direct request to the LLM provider without any agent processing:
+ /// - No memory or context retrieval
+ /// - No tool calling
+ /// - No message persistence
+ /// - No agent state modification
+ /// Simply provide a prompt, and the endpoint formats it as a user message.
+ /// Optionally include a system_prompt for context/instructions.
+ /// The agent's LLM configuration (model, credentials, settings) is used by default.
+ /// Use override_model to switch to a different model/provider while still using
+ /// the organization's configured providers.
+ /// Example use cases:
+ /// - Quick LLM queries without agent overhead
+ /// - Testing different models with the same prompt
+ /// - Simple chat completions using agent's credentials
+ /// - Comparing model outputs on identical prompts + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// The prompt/message to send to the LLM /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ImportAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ImportAgent.g.cs index cf346dc3..bbef4c8c 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ImportAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ImportAgent.g.cs @@ -28,6 +28,22 @@ public partial interface IAgentsClient /// Returns the IDs of all imported agents. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImportAgentAsResponseAsync( + + global::Letta.BodyImportAgent request, + string? xOverrideEmbeddingModel = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents. + ///
+ /// /// /// /// @@ -65,5 +81,96 @@ public partial interface IAgentsClient string? model = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents. + ///
+ /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.
+ /// Default Value: true + /// + /// + /// If set to True, strips all messages from the agent before importing.
+ /// Default Value: false + /// + /// + /// Secrets as a JSON string to pass to the agent for tool execution. + /// + /// + /// If provided, overrides the agent name with this value. + /// + /// + /// Embedding handle to override with. + /// + /// + /// Model handle to override the agent's default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ImportAgentAsync( + global::System.IO.Stream file, + string filename, + string? xOverrideEmbeddingModel = default, + bool? overrideExistingTools = default, + bool? stripMessages = default, + string? secrets = default, + string? name = default, + string? embedding = default, + string? model = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Import Agent
+ /// Import a serialized agent file and recreate the agent(s) in the system.
+ /// Returns the IDs of all imported agents. + ///
+ /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// + /// If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.
+ /// Default Value: true + /// + /// + /// If set to True, strips all messages from the agent before importing.
+ /// Default Value: false + /// + /// + /// Secrets as a JSON string to pass to the agent for tool execution. + /// + /// + /// If provided, overrides the agent name with this value. + /// + /// + /// Embedding handle to override with. + /// + /// + /// Model handle to override the agent's default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ImportAgentAsResponseAsync( + global::System.IO.Stream file, + string filename, + string? xOverrideEmbeddingModel = default, + bool? overrideExistingTools = default, + bool? stripMessages = default, + string? secrets = default, + string? name = default, + string? embedding = default, + string? model = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListAgents.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListAgents.g.cs index 77f4cc18..3e83fd16 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListAgents.g.cs @@ -103,5 +103,102 @@ public partial interface IAgentsClient string? createdById = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents
+ /// Get a list of all agents. + ///
+ /// + /// Name of the agent + /// + /// + /// List of tags to filter agents by + /// + /// + /// If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Cursor for pagination + /// + /// + /// Cursor for pagination + /// + /// + /// Limit for pagination
+ /// Default Value: 50 + /// + /// + /// Search agents by name + /// + /// + /// Search agents by project ID - this will default to your default project on cloud + /// + /// + /// Search agents by template ID + /// + /// + /// Search agents by base template ID + /// + /// + /// Search agents by identity ID + /// + /// + /// Search agents by identifier keys + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default)
+ /// Default Value: false + /// + /// + /// Field to sort by. Options: 'created_at' (default), 'last_run_completion'
+ /// Default Value: created_at + /// + /// + /// Filter agents by their last stop reason. + /// + /// + /// Filter agents by the user who created them. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsAsResponseAsync( + string? name = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + string? before = default, + string? after = default, + int? limit = default, + string? queryText = default, + string? projectId = default, + string? templateId = default, + string? baseTemplateId = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.ListAgentsOrder? order = default, + global::Letta.ListAgentsOrderBy? orderBy = default, + bool? ascending = default, + string? sortBy = default, + global::Letta.StopReasonType? lastStopReason = default, + string? createdById = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListCoreMemoryBlocks.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListCoreMemoryBlocks.g.cs index 1b88c446..23e7295b 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListCoreMemoryBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListCoreMemoryBlocks.g.cs @@ -41,5 +41,42 @@ public partial interface IAgentsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Blocks For Agent
+ /// Retrieve the core memory blocks of a specific agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order + /// + /// + /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order + /// + /// + /// Maximum number of blocks to return
+ /// Default Value: 100 + /// + /// + /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListCoreMemoryBlocksAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListCoreMemoryBlocksOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListFilesForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListFilesForAgent.g.cs index bab02803..2a796cfc 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListFilesForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListFilesForAgent.g.cs @@ -51,5 +51,50 @@ public partial interface IAgentsClient bool? isOpen = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Files For Agent
+ /// Get the files attached to an agent with their open/closed status. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// File ID cursor for pagination. Returns files that come before this file ID in the specified sort order + /// + /// + /// File ID cursor for pagination. Returns files that come after this file ID in the specified sort order + /// + /// + /// Maximum number of files to return
+ /// Default Value: 100 + /// + /// + /// Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Pagination cursor from previous response (deprecated, use before/after) + /// + /// + /// Filter by open status (true for open files, false for closed files) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListFilesForAgentAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFilesForAgentOrder? order = default, + string? orderBy = default, + string? cursor = default, + bool? isOpen = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListFoldersForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListFoldersForAgent.g.cs index f72ceb09..19f39de9 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListFoldersForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListFoldersForAgent.g.cs @@ -41,5 +41,42 @@ public partial interface IAgentsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Folders For Agent
+ /// Get the folders associated with an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order + /// + /// + /// Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order + /// + /// + /// Maximum number of sources to return
+ /// Default Value: 100 + /// + /// + /// Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListFoldersForAgentAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFoldersForAgentOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListGroupsForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListGroupsForAgent.g.cs index 04eef953..87063926 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListGroupsForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListGroupsForAgent.g.cs @@ -45,5 +45,46 @@ public partial interface IAgentsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Groups For Agent
+ /// Lists the groups for an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Manager type to filter groups by + /// + /// + /// Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order + /// + /// + /// Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order + /// + /// + /// Maximum number of groups to return
+ /// Default Value: 100 + /// + /// + /// Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListGroupsForAgentAsResponseAsync( + string agentId, + string? managerType = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListGroupsForAgentOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListMessages.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListMessages.g.cs index e7ec9061..d0bc68f9 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListMessages.g.cs @@ -74,5 +74,73 @@ public partial interface IAgentsClient global::System.Collections.Generic.IList? includeReturnMessageTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Messages
+ /// Retrieve message history for an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Group ID to filter messages by. + /// + /// + /// Conversation ID to filter messages by. + /// + /// + /// Whether to use assistant messages
+ /// Default Value: true + /// + /// + /// The name of the designated message tool.
+ /// Default Value: send_message + /// + /// + /// The name of the message argument.
+ /// Default Value: message + /// + /// + /// Whether to include error messages and error statuses. For debugging purposes only. + /// + /// + /// Message types to include in response. When null, all message types are returned. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListMessagesAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesOrder? order = default, + string? orderBy = default, + string? groupId = default, + string? conversationId = default, + bool? useAssistantMessage = default, + string? assistantMessageToolName = default, + string? assistantMessageToolKwarg = default, + bool? includeErr = default, + global::System.Collections.Generic.IList? includeReturnMessageTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListPassages.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListPassages.g.cs index f029f45f..ff58c282 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListPassages.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListPassages.g.cs @@ -40,5 +40,41 @@ public partial interface IAgentsClient bool? ascending = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Passages
+ /// Retrieve the memories in an agent's archival memory store (paginated query). + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Unique ID of the memory to start the query range at. + /// + /// + /// Unique ID of the memory to end the query range at. + /// + /// + /// How many results to include in the response.
+ /// Default Value: 100 + /// + /// + /// Search passages by text + /// + /// + /// Whether to sort passages oldest to newest (True, default) or newest to oldest (False)
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListPassagesAsResponseAsync( + string agentId, + string? after = default, + string? before = default, + int? limit = default, + string? search = default, + bool? ascending = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ListToolsForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ListToolsForAgent.g.cs index 5fdd545d..dd28f223 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ListToolsForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ListToolsForAgent.g.cs @@ -41,5 +41,42 @@ public partial interface IAgentsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Tools For Agent
+ /// Get tools from an existing agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order + /// + /// + /// Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order + /// + /// + /// Maximum number of tools to return
+ /// Default Value: 10 + /// + /// + /// Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListToolsForAgentAsResponseAsync( + string agentId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListToolsForAgentOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyAgent.g.cs index a7b4bac4..6d02db27 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyAgent.g.cs @@ -30,6 +30,23 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyAgentAsResponseAsync( + string agentId, + + global::Letta.UpdateAgent request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Agent
+ /// Update an existing agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// The name of the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyApprovalForTool.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyApprovalForTool.g.cs index 4e2af6f0..838f9d05 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyApprovalForTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyApprovalForTool.g.cs @@ -42,6 +42,30 @@ public partial interface IAgentsClient /// /// Whether the tool requires approval before execution /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyApprovalForToolAsResponseAsync( + string toolName, + string agentId, + + global::Letta.ModifyApprovalRequest request, + bool? requiresApproval = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Approval For Tool
+ /// Modify the approval requirement for a tool attached to an agent.
+ /// Accepts requires_approval via request body (preferred) or query parameter (deprecated). + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Whether the tool requires approval before execution + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyCoreMemoryBlock.g.cs index c3182bb1..4e096ccb 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ModifyCoreMemoryBlock.g.cs @@ -31,6 +31,25 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyCoreMemoryBlockAsResponseAsync( + string blockLabel, + string agentId, + + global::Letta.BlockUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Block For Agent
+ /// Updates a core memory block of an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// Value of the block. /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.OpenFileForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.OpenFileForAgent.g.cs index dc2ffedc..eba4e669 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.OpenFileForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.OpenFileForAgent.g.cs @@ -25,5 +25,26 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Open File For Agent
+ /// Opens a specific file for a given agent.
+ /// This endpoint marks a specific file as open in the agent's file state.
+ /// The file will be included in the agent's working memory view.
+ /// Returns a list of file names that were closed due to LRU eviction. + ///
+ /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> OpenFileForAgentAsResponseAsync( + string fileId, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.PreviewModelRequest.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.PreviewModelRequest.g.cs index d5738827..dcd775dc 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.PreviewModelRequest.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.PreviewModelRequest.g.cs @@ -34,6 +34,26 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PreviewModelRequestAsResponseAsync( + string agentId, + + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Preview Model Request
+ /// Inspect the raw LLM request payload without sending it.
+ /// This endpoint processes the message through the agent loop up until
+ /// the LLM request, then returns the raw request payload that would
+ /// be sent to the LLM provider. Useful for debugging and inspection. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.RecompileAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.RecompileAgent.g.cs index 3e894e65..fd2de91c 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.RecompileAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.RecompileAgent.g.cs @@ -28,5 +28,29 @@ public partial interface IAgentsClient bool? dryRun = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Recompile Agent
+ /// Manually trigger system prompt recompilation for an agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// If True, update the in-context memory last edit timestamp embedded in the system prompt.
+ /// Default Value: false + /// + /// + /// If True, do not persist changes; still returns the compiled system prompt.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RecompileAgentAsResponseAsync( + string agentId, + bool? updateTimestamp = default, + bool? dryRun = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.ResetMessages.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.ResetMessages.g.cs index 7bf12f9b..1d499226 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.ResetMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.ResetMessages.g.cs @@ -28,6 +28,23 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ResetMessagesAsResponseAsync( + string agentId, + + global::Letta.ResetMessagesRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reset Messages
+ /// Resets the messages for an agent + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// If true, adds the default initial messages after resetting.
/// Default Value: false diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveAgent.g.cs index c435109d..5d06521f 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveAgent.g.cs @@ -29,5 +29,28 @@ public partial interface IAgentsClient global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Agent
+ /// Get the state of the agent. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveAgentAsResponseAsync( + string agentId, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveCoreMemoryBlock.g.cs index 0f170437..2dba7b03 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.RetrieveCoreMemoryBlock.g.cs @@ -20,5 +20,21 @@ public partial interface IAgentsClient string agentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Block For Agent
+ /// Retrieve a core memory block from an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveCoreMemoryBlockAsResponseAsync( + string blockLabel, + string agentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.RunToolForAgent.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.RunToolForAgent.g.cs index eb875950..3d7073fd 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.RunToolForAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.RunToolForAgent.g.cs @@ -35,6 +35,27 @@ public partial interface IAgentsClient /// The ID of the agent in the format 'agent-<uuid4>' /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunToolForAgentAsResponseAsync( + string agentId, + string toolName, + + global::Letta.LettaSchemasMcpServerToolExecuteRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Tool For Agent
+ /// Trigger a tool by name on a specific agent, providing the necessary arguments.
+ /// This endpoint executes a tool that is attached to the agent, using the agent's
+ /// state and environment variables for execution context. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// /// /// Arguments to pass to the tool /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.SearchArchivalMemory.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.SearchArchivalMemory.g.cs index 0e6feceb..169fc288 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.SearchArchivalMemory.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.SearchArchivalMemory.g.cs @@ -46,5 +46,47 @@ public partial interface IAgentsClient global::System.DateTime? endDatetime = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search Archival Memory
+ /// Search archival memory using semantic (embedding-based) search with optional temporal filtering.
+ /// This endpoint allows manual triggering of archival memory searches, enabling users to query
+ /// an agent's archival memory store directly via the API. The search uses the same functionality
+ /// as the agent's archival_memory_search tool but is accessible for external API usage. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// String to search for using semantic similarity + /// + /// + /// Optional list of tags to filter search results + /// + /// + /// How to match tags - 'any' to match passages with any of the tags, 'all' to match only passages with all tags
+ /// Default Value: any + /// + /// + /// Maximum number of results to return. Uses system default if not specified + /// + /// + /// Filter results to passages created after this datetime + /// + /// + /// Filter results to passages created before this datetime + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SearchArchivalMemoryAsResponseAsync( + string agentId, + string query, + global::System.Collections.Generic.IList? tags = default, + global::Letta.SearchArchivalMemoryTagMatchMode? tagMatchMode = default, + int? topK = default, + global::System.DateTime? startDatetime = default, + global::System.DateTime? endDatetime = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.SearchMessages.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.SearchMessages.g.cs index 2de846c1..8511c73f 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.SearchMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.SearchMessages.g.cs @@ -23,6 +23,20 @@ public partial interface IAgentsClient /// Search messages across the entire organization with optional project and template filtering. Returns messages with FTS/vector ranks and total RRF score.
/// This is a cloud-only feature. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> SearchMessagesAsResponseAsync( + + global::Letta.MessageSearchRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search Messages
+ /// Search messages across the entire organization with optional project and template filtering. Returns messages with FTS/vector ranks and total RRF score.
+ /// This is a cloud-only feature. + ///
/// /// Text query for full-text search /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.SendMessage.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.SendMessage.g.cs index 24d2b4f1..555c5f81 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.SendMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.SendMessage.g.cs @@ -52,6 +52,34 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SendMessageAsResponseAsync( + string agentId, + + global::Letta.LettaStreamingRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Send Message
+ /// Process a user message and return the agent's response.
+ /// This endpoint accepts a message from a user and processes it through the agent.
+ /// **Note:** Sending multiple concurrent requests to the same agent can lead to undefined behavior.
+ /// Each agent processes messages sequentially, and concurrent requests may interleave in unexpected ways.
+ /// Wait for each request to complete before sending the next one. Use separate agents or conversations for parallel processing.
+ /// The response format is controlled by the `streaming` field in the request body:
+ /// - If `streaming=false` (default): Returns a complete LettaResponse with all messages
+ /// - If `streaming=true`: Returns a Server-Sent Events (SSE) stream
+ /// Additional streaming options (only used when streaming=true):
+ /// - `stream_tokens`: Stream individual tokens instead of complete steps
+ /// - `include_pings`: Include keepalive pings to prevent connection timeouts
+ /// - `background`: Process the request in the background + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// The messages to be sent to the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IAgentsClient.SummarizeMessages.g.cs b/src/libs/Letta/Generated/Letta.IAgentsClient.SummarizeMessages.g.cs index 49a2ea8b..8f00bd42 100644 --- a/src/libs/Letta/Generated/Letta.IAgentsClient.SummarizeMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IAgentsClient.SummarizeMessages.g.cs @@ -28,6 +28,23 @@ public partial interface IAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SummarizeMessagesAsResponseAsync( + string agentId, + + global::Letta.LettaServerRestApiRoutersV1AgentsCompactionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Summarize Messages
+ /// Summarize an agent's conversation history. + ///
+ /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.CreateArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.CreateArchive.g.cs index 254f5750..564835b8 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.CreateArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.CreateArchive.g.cs @@ -23,6 +23,19 @@ public partial interface IArchivesClient /// Create Archive
/// Create a new archive. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateArchiveAsResponseAsync( + + global::Letta.ArchiveCreateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Archive
+ /// Create a new archive. + ///
/// /// /// Embedding model handle for the archive diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassageInArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassageInArchive.g.cs index 1c1f1324..ccf4c045 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassageInArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassageInArchive.g.cs @@ -30,6 +30,24 @@ public partial interface IArchivesClient /// /// The ID of the archive in the format 'archive-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreatePassageInArchiveAsResponseAsync( + string archiveId, + + global::Letta.PassageCreateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Passage In Archive
+ /// Create a new passage in an archive.
+ /// This adds a passage to the archive and creates embeddings for vector storage. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// /// /// The text content of the passage /// diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassagesInArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassagesInArchive.g.cs index e8197927..69333fee 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassagesInArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.CreatePassagesInArchive.g.cs @@ -30,6 +30,24 @@ public partial interface IArchivesClient /// /// The ID of the archive in the format 'archive-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> CreatePassagesInArchiveAsResponseAsync( + string archiveId, + + global::Letta.PassageBatchCreateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Passages In Archive
+ /// Create multiple passages in an archive.
+ /// This adds passages to the archive and creates embeddings for vector storage. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// /// /// Passages to create in the archive /// diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.DeleteArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.DeleteArchive.g.cs index 3f54707f..c7315dc4 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.DeleteArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.DeleteArchive.g.cs @@ -18,5 +18,19 @@ public partial interface IArchivesClient string archiveId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Archive
+ /// Delete an archive by its ID. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteArchiveAsResponseAsync( + string archiveId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.DeletePassageFromArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.DeletePassageFromArchive.g.cs index 9bd972d8..88011309 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.DeletePassageFromArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.DeletePassageFromArchive.g.cs @@ -23,5 +23,24 @@ public partial interface IArchivesClient string passageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Passage From Archive
+ /// Delete a passage from an archive.
+ /// This permanently removes the passage from both the database and vector storage (if applicable). + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// The ID of the passage in the format 'passage-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeletePassageFromArchiveAsResponseAsync( + string archiveId, + string passageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.ListAgentsForArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.ListAgentsForArchive.g.cs index 228ea9cb..5cf65f0b 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.ListAgentsForArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.ListAgentsForArchive.g.cs @@ -41,5 +41,42 @@ public partial interface IArchivesClient global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents For Archive
+ /// Get a list of agents that have access to an archive with pagination support. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsForArchiveAsResponseAsync( + string archiveId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForArchiveOrder? order = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.ListArchives.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.ListArchives.g.cs index 4310b190..bd284aae 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.ListArchives.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.ListArchives.g.cs @@ -45,5 +45,46 @@ public partial interface IArchivesClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Archives
+ /// Get a list of all archives for the current organization with optional filters and pagination. + ///
+ /// + /// Archive ID cursor for pagination. Returns archives that come before this archive ID in the specified sort order + /// + /// + /// Archive ID cursor for pagination. Returns archives that come after this archive ID in the specified sort order + /// + /// + /// Maximum number of archives to return
+ /// Default Value: 50 + /// + /// + /// Sort order for archives by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter by archive name (exact match) + /// + /// + /// Only archives attached to this agent ID + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListArchivesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListArchivesOrder? order = default, + string? orderBy = default, + string? name = default, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.ModifyArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.ModifyArchive.g.cs index 662b25b1..48a8adac 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.ModifyArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.ModifyArchive.g.cs @@ -28,6 +28,23 @@ public partial interface IArchivesClient /// /// The ID of the archive in the format 'archive-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyArchiveAsResponseAsync( + string archiveId, + + global::Letta.ArchiveUpdateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Archive
+ /// Update an existing archive's name and/or description. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Letta/Generated/Letta.IArchivesClient.RetrieveArchive.g.cs b/src/libs/Letta/Generated/Letta.IArchivesClient.RetrieveArchive.g.cs index 6222739b..c0bc8916 100644 --- a/src/libs/Letta/Generated/Letta.IArchivesClient.RetrieveArchive.g.cs +++ b/src/libs/Letta/Generated/Letta.IArchivesClient.RetrieveArchive.g.cs @@ -18,5 +18,19 @@ public partial interface IArchivesClient string archiveId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Archive
+ /// Get a single archive by its ID. + ///
+ /// + /// The ID of the archive in the format 'archive-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveArchiveAsResponseAsync( + string archiveId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.AttachIdentityToBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.AttachIdentityToBlock.g.cs index 1744589a..3faca191 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.AttachIdentityToBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.AttachIdentityToBlock.g.cs @@ -20,5 +20,21 @@ public partial interface IBlocksClient string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Attach Identity To Block
+ /// Attach an identity to a block. + ///
+ /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AttachIdentityToBlockAsResponseAsync( + string identityId, + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.CountBlocks.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.CountBlocks.g.cs index 26081088..70d5663d 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.CountBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.CountBlocks.g.cs @@ -41,5 +41,42 @@ public partial interface IBlocksClient string? projectId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Blocks
+ /// Count all blocks with optional filtering.
+ /// Supports the same filters as list_blocks for consistent querying. + ///
+ /// + /// Label to include (alphanumeric, hyphens, underscores, forward slashes) + /// + /// + /// Whether to include only templates
+ /// Default Value: false + /// + /// + /// Name filter (alphanumeric, spaces, hyphens, underscores) + /// + /// + /// List of tags to filter blocks by + /// + /// + /// If True, only counts blocks that match ALL given tags. Otherwise, counts blocks that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Search blocks by project id + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CountBlocksAsResponseAsync( + string? label = default, + bool? templatesOnly = default, + string? name = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + string? projectId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.CreateBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.CreateBlock.g.cs index 735e3c3f..20691045 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.CreateBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.CreateBlock.g.cs @@ -19,6 +19,18 @@ public partial interface IBlocksClient /// /// Create Block /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateBlockAsResponseAsync( + + global::Letta.CreateBlock request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Block + /// /// /// Value of the block. /// diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.DeleteBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.DeleteBlock.g.cs index dd2e2cd4..a439cae7 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.DeleteBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.DeleteBlock.g.cs @@ -17,5 +17,18 @@ public partial interface IBlocksClient string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteBlockAsResponseAsync( + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.DetachIdentityFromBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.DetachIdentityFromBlock.g.cs index 0fa0bfa7..d0aefa27 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.DetachIdentityFromBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.DetachIdentityFromBlock.g.cs @@ -20,5 +20,21 @@ public partial interface IBlocksClient string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detach Identity From Block
+ /// Detach an identity from a block. + ///
+ /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetachIdentityFromBlockAsResponseAsync( + string identityId, + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.ListAgentsForBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.ListAgentsForBlock.g.cs index 3a4997fd..bdd9a5f5 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.ListAgentsForBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.ListAgentsForBlock.g.cs @@ -53,5 +53,52 @@ public partial interface IBlocksClient global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents For Block
+ /// Retrieves all agents associated with the specified block.
+ /// Raises a 404 if the block does not exist. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsForBlockAsResponseAsync( + string blockId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForBlockOrder? order = default, + string? orderBy = default, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.ListBlocks.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.ListBlocks.g.cs index ca7e54a1..66c3c16a 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.ListBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.ListBlocks.g.cs @@ -94,5 +94,95 @@ public partial interface IBlocksClient global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Blocks + /// + /// + /// Label to include (alphanumeric, hyphens, underscores, forward slashes) + /// + /// + /// Whether to include only templates
+ /// Default Value: false + /// + /// + /// Name filter (alphanumeric, spaces, hyphens, underscores) + /// + /// + /// The ID of the identity in the format 'identity-<uuid4>' + /// + /// + /// Search agents by identifier keys + /// + /// + /// Search blocks by project id + /// + /// + /// List of tags to filter blocks by + /// + /// + /// If True, only returns blocks that match ALL given tags. Otherwise, return blocks that have ANY of the passed-in tags.
+ /// Default Value: false + /// + /// + /// Number of blocks to return
+ /// Default Value: 50 + /// + /// + /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order + /// + /// + /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order + /// + /// + /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Search blocks by label. If provided, returns blocks whose label matches the search query. This is a full-text search on block labels. + /// + /// + /// Search blocks by description. If provided, returns blocks whose description matches the search query. This is a full-text search on block descriptions. + /// + /// + /// Search blocks by value. If provided, returns blocks whose value matches the search query. This is a full-text search on block values. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have more than this number of connected agents. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have less than this number of connected agents. + /// + /// + /// Filter blocks by the exact number of connected agents. If provided, returns blocks that have exactly this number of connected agents. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListBlocksAsResponseAsync( + string? label = default, + bool? templatesOnly = default, + string? name = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + string? projectId = default, + global::System.Collections.Generic.IList? tags = default, + bool? matchAllTags = default, + int? limit = default, + string? before = default, + string? after = default, + global::Letta.ListBlocksOrder? order = default, + string? orderBy = default, + string? labelSearch = default, + string? descriptionSearch = default, + string? valueSearch = default, + int? connectedToAgentsCountGt = default, + int? connectedToAgentsCountLt = default, + global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.ModifyBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.ModifyBlock.g.cs index 3093fef4..3d1c81f2 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.ModifyBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.ModifyBlock.g.cs @@ -26,6 +26,22 @@ public partial interface IBlocksClient /// /// The ID of the block in the format 'block-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyBlockAsResponseAsync( + string blockId, + + global::Letta.BlockUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// /// /// Value of the block. /// diff --git a/src/libs/Letta/Generated/Letta.IBlocksClient.RetrieveBlock.g.cs b/src/libs/Letta/Generated/Letta.IBlocksClient.RetrieveBlock.g.cs index bda74b91..64ff7c47 100644 --- a/src/libs/Letta/Generated/Letta.IBlocksClient.RetrieveBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IBlocksClient.RetrieveBlock.g.cs @@ -17,5 +17,18 @@ public partial interface IBlocksClient string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveBlockAsResponseAsync( + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IChatClient.CreateChatCompletion.g.cs b/src/libs/Letta/Generated/Letta.IChatClient.CreateChatCompletion.g.cs index bcde25a8..be3f3faa 100644 --- a/src/libs/Letta/Generated/Letta.IChatClient.CreateChatCompletion.g.cs +++ b/src/libs/Letta/Generated/Letta.IChatClient.CreateChatCompletion.g.cs @@ -29,6 +29,23 @@ public partial interface IChatClient /// When streaming is enabled (stream=true), the response will be Server-Sent Events
/// with ChatCompletionChunk objects. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateChatCompletionAsResponseAsync( + + global::Letta.ChatCompletionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Chat Completion
+ /// Create a chat completion using a Letta agent (OpenAI-compatible).
+ /// This endpoint provides full OpenAI API compatibility. The agent is selected based on:
+ /// - The 'model' parameter in the request (should contain an agent ID in format 'agent-...')
+ /// When streaming is enabled (stream=true), the response will be Server-Sent Events
+ /// with ChatCompletionChunk objects. + ///
/// /// ID of the model to use /// diff --git a/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs b/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs index 2051ae97..b208a187 100644 --- a/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs +++ b/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensCreateClientSideAccessToken.g.cs @@ -21,6 +21,19 @@ public partial interface IClientSideAccessTokensClient /// Create token (Cloud-only)
/// Create a new client side access token with the specified configuration. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ClientSideAccessTokensCreateClientSideAccessTokenAsResponseAsync( + + global::Letta.ClientSideAccessTokensCreateClientSideAccessTokenRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create token (Cloud-only)
+ /// Create a new client side access token with the specified configuration. + ///
/// /// /// The hostname of the client side application. Please specify the full URL including the protocol (http or https). diff --git a/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs b/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs index cd58de67..26712264 100644 --- a/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs +++ b/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensDeleteClientSideAccessToken.g.cs @@ -24,6 +24,21 @@ public partial interface IClientSideAccessTokensClient /// Delete a client side access token. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ClientSideAccessTokensDeleteClientSideAccessTokenAsResponseAsync( + string token, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete token (Cloud-only)
+ /// Delete a client side access token. + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs b/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs index 3c6db7c4..917cda46 100644 --- a/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs +++ b/src/libs/Letta/Generated/Letta.IClientSideAccessTokensClient.ClientSideAccessTokensListClientSideAccessTokens.g.cs @@ -24,5 +24,25 @@ public partial interface IClientSideAccessTokensClient double? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List tokens (Cloud-only)
+ /// List all client side access tokens for the current account. This is only available for cloud users. + ///
+ /// + /// + /// Default Value: 0 + /// + /// + /// Default Value: 10 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ClientSideAccessTokensListClientSideAccessTokensAsResponseAsync( + string? agentId = default, + double? offset = default, + double? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.CancelConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.CancelConversation.g.cs index 04ef70a6..8c7aebb1 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.CancelConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.CancelConversation.g.cs @@ -26,5 +26,27 @@ public partial interface IConversationsClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel Conversation
+ /// Cancel runs associated with a conversation.
+ /// Note: To cancel active runs, Redis is required.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id query parameter
+ /// to cancel runs for the agent's default conversation.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Agent ID for agent-direct mode with 'default' conversation + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelConversationAsResponseAsync( + string conversationId, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.CompactConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.CompactConversation.g.cs index da56ebe0..b3303b56 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.CompactConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.CompactConversation.g.cs @@ -38,6 +38,28 @@ public partial interface IConversationsClient /// /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CompactConversationAsResponseAsync( + string conversationId, + + global::Letta.LettaServerRestApiRoutersV1ConversationsCompactionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Compact Conversation
+ /// Compact (summarize) a conversation's message history.
+ /// This endpoint summarizes the in-context messages for a specific conversation,
+ /// reducing the message count while preserving important context.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id in request body
+ /// to compact the agent's default conversation messages.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.CreateConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.CreateConversation.g.cs index 8ce6d30b..bb774798 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.CreateConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.CreateConversation.g.cs @@ -28,6 +28,23 @@ public partial interface IConversationsClient /// /// The agent ID to create a conversation for /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateConversationAsResponseAsync( + string agentId, + + global::Letta.CreateConversation request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Conversation
+ /// Create a new conversation for an agent. + ///
+ /// + /// The agent ID to create a conversation for + /// /// /// A summary of the conversation. /// diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.DeleteConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.DeleteConversation.g.cs index 9eeba93e..9704f5d4 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.DeleteConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.DeleteConversation.g.cs @@ -21,5 +21,22 @@ public partial interface IConversationsClient string conversationId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Conversation
+ /// Delete a conversation (soft delete).
+ /// This marks the conversation as deleted but does not permanently remove it from the database.
+ /// The conversation will no longer appear in list operations.
+ /// Any isolated blocks associated with the conversation will be permanently deleted. + ///
+ /// + /// The ID of the conv in the format 'conv-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteConversationAsResponseAsync( + string conversationId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.ForkConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.ForkConversation.g.cs index 044288d6..5e9eb352 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.ForkConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.ForkConversation.g.cs @@ -28,5 +28,29 @@ public partial interface IConversationsClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fork Conversation
+ /// Fork an existing conversation.
+ /// Creates a new conversation that shares the same in-context messages as the source
+ /// conversation, but with a newly compiled system message reflecting the latest memory
+ /// block values. The forked conversation belongs to the same agent as the source.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id query parameter
+ /// to fork the agent's default (agent-direct) message history into a new conversation.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Agent ID for agent-direct mode with 'default' conversation + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ForkConversationAsResponseAsync( + string conversationId, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversationMessages.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversationMessages.g.cs index ebc8328e..c1027862 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversationMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversationMessages.g.cs @@ -62,5 +62,63 @@ public partial interface IConversationsClient global::System.Collections.Generic.IList? includeReturnMessageTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Conversation Messages
+ /// List all messages in a conversation.
+ /// Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all
+ /// messages in the conversation, with support for cursor-based pagination.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id parameter
+ /// to list messages from the agent's default conversation.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// Agent ID for agent-direct mode with 'default' conversation + /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Group ID to filter messages by. + /// + /// + /// Whether to include error messages and error statuses. For debugging purposes only. + /// + /// + /// Message types to include in response. When null, all message types are returned. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListConversationMessagesAsResponseAsync( + string conversationId, + string? agentId = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListConversationMessagesOrder? order = default, + string? orderBy = default, + string? groupId = default, + bool? includeErr = default, + global::System.Collections.Generic.IList? includeReturnMessageTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversations.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversations.g.cs index 4e14aee2..40449329 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversations.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.ListConversations.g.cs @@ -41,5 +41,42 @@ public partial interface IConversationsClient global::Letta.ListConversationsOrderBy? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Conversations
+ /// List all conversations for an agent (or all conversations if agent_id not provided). + ///
+ /// + /// The agent ID to list conversations for (optional - returns all conversations if not provided) + /// + /// + /// Maximum number of conversations to return
+ /// Default Value: 50 + /// + /// + /// Cursor for pagination (conversation ID) + /// + /// + /// Search for text within conversation summaries + /// + /// + /// Sort order for conversations. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListConversationsAsResponseAsync( + string? agentId = default, + int? limit = default, + string? after = default, + string? summarySearch = default, + global::Letta.ListConversationsOrder? order = default, + global::Letta.ListConversationsOrderBy? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.PreviewConversationModelRequest.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.PreviewConversationModelRequest.g.cs index 393017ba..ba5ee39b 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.PreviewConversationModelRequest.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.PreviewConversationModelRequest.g.cs @@ -38,6 +38,27 @@ public partial interface IConversationsClient /// /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PreviewConversationModelRequestAsResponseAsync( + string conversationId, + + global::Letta.ConversationMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Preview Conversation Model Request
+ /// Inspect the raw LLM request payload for a conversation message without sending it.
+ /// This endpoint processes the message through the same path as send_conversation_message
+ /// (including conversation-scoped messages, isolated blocks, model overrides, and
+ /// client tools/skills) but stops before the LLM call and returns the raw request
+ /// payload. Useful for debugging and verifying what the LLM will actually see. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// /// /// The messages to be sent to the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.RecompileConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.RecompileConversation.g.cs index 81c17755..569310d4 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.RecompileConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.RecompileConversation.g.cs @@ -37,6 +37,28 @@ public partial interface IConversationsClient /// If True, do not persist changes; still returns the compiled system prompt.
/// Default Value: false /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RecompileConversationAsResponseAsync( + string conversationId, + + global::Letta.LettaServerRestApiRoutersV1ConversationsCompactionRequest request, + bool? dryRun = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Recompile Conversation
+ /// Manually trigger system prompt recompilation for a conversation. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// + /// + /// If True, do not persist changes; still returns the compiled system prompt.
+ /// Default Value: false + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversation.g.cs index a903fcfe..357c9034 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversation.g.cs @@ -18,5 +18,19 @@ public partial interface IConversationsClient string conversationId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Conversation
+ /// Retrieve a specific conversation. + ///
+ /// + /// The ID of the conv in the format 'conv-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveConversationAsResponseAsync( + string conversationId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversationStream.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversationStream.g.cs index d54cd04e..5b25d057 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversationStream.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.RetrieveConversationStream.g.cs @@ -46,6 +46,32 @@ public partial interface IConversationsClient /// /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveConversationStreamAsResponseAsync( + string conversationId, + + global::Letta.RetrieveStreamRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Conversation Stream
+ /// Resume the stream for the most recent active run in a conversation.
+ /// This endpoint allows you to reconnect to an active background stream
+ /// for a conversation, enabling recovery from network interruptions.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id in request body
+ /// to retrieve the stream for the agent's most recent active run.
+ /// **Direct run access**: Pass run_id directly to skip run lookup entirely.
+ /// Useful for recovery from duplicate request 409 errors.
+ /// **OTID lookup**: Pass otid to look up the run_id from Redis.
+ /// Useful when you have the otid from a 409 error response.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// /// /// Agent ID for agent-direct mode with 'default' conversation. Use with conversation_id='default' in the URL path. /// diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.SendConversationMessage.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.SendConversationMessage.g.cs index 34c5805a..7b603752 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.SendConversationMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.SendConversationMessage.g.cs @@ -42,6 +42,29 @@ public partial interface IConversationsClient /// /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SendConversationMessageAsResponseAsync( + string conversationId, + + global::Letta.ConversationMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Send Conversation Message
+ /// Send a message to a conversation and get a response.
+ /// This endpoint sends a message to an existing conversation.
+ /// By default (streaming=true), returns a streaming response (Server-Sent Events).
+ /// Set streaming=false to get a complete JSON response.
+ /// **Agent-direct mode**: Pass conversation_id="default" with agent_id in request body
+ /// to send messages to the agent's default conversation with locking.
+ /// **Deprecated**: Passing an agent ID as conversation_id still works but will be removed. + ///
+ /// + /// The conversation identifier. Can be a conversation ID ('conv-<uuid4>'), 'default' for agent-direct mode (with agent_id parameter), or an agent ID ('agent-<uuid4>') for backwards compatibility (deprecated). + /// /// /// The messages to be sent to the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IConversationsClient.UpdateConversation.g.cs b/src/libs/Letta/Generated/Letta.IConversationsClient.UpdateConversation.g.cs index 16b02740..a4ce0292 100644 --- a/src/libs/Letta/Generated/Letta.IConversationsClient.UpdateConversation.g.cs +++ b/src/libs/Letta/Generated/Letta.IConversationsClient.UpdateConversation.g.cs @@ -28,6 +28,23 @@ public partial interface IConversationsClient /// /// The ID of the conv in the format 'conv-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateConversationAsResponseAsync( + string conversationId, + + global::Letta.UpdateConversation request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Conversation
+ /// Update a conversation. + ///
+ /// + /// The ID of the conv in the format 'conv-<uuid4>' + /// /// /// A summary of the conversation. /// diff --git a/src/libs/Letta/Generated/Letta.IDeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs b/src/libs/Letta/Generated/Letta.IDeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs index baf3a2ba..3e135222 100644 --- a/src/libs/Letta/Generated/Letta.IDeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs +++ b/src/libs/Letta/Generated/Letta.IDeviceStorageClient.DeviceStorageGetDeviceStorageKey.g.cs @@ -16,5 +16,17 @@ public partial interface IDeviceStorageClient string deviceId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Device Storage Key
+ /// Returns an HMAC-derived AES-256-GCM key scoped to the authenticated user and device. Used to encrypt/decrypt local IndexedDB caches on the client. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeviceStorageGetDeviceStorageKeyAsResponseAsync( + string deviceId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IEmbeddingsClient.GetTotalStorageSize.g.cs b/src/libs/Letta/Generated/Letta.IEmbeddingsClient.GetTotalStorageSize.g.cs index e0f05c71..5cdcd000 100644 --- a/src/libs/Letta/Generated/Letta.IEmbeddingsClient.GetTotalStorageSize.g.cs +++ b/src/libs/Letta/Generated/Letta.IEmbeddingsClient.GetTotalStorageSize.g.cs @@ -18,5 +18,19 @@ public partial interface IEmbeddingsClient string? storageUnit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Embeddings Total Storage Size
+ /// Get the total size of all embeddings in the database for a user in the storage unit given. + ///
+ /// + /// Default Value: GB + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTotalStorageSizeAsResponseAsync( + string? storageUnit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs index a855d160..077217ba 100644 --- a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs +++ b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsDeleteEnvironment.g.cs @@ -24,6 +24,21 @@ public partial interface IEnvironmentsClient /// Removes environment from list of environments /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EnvironmentsDeleteEnvironmentAsResponseAsync( + string id, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Environment
+ /// Removes environment from list of environments + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsGetConnection.g.cs b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsGetConnection.g.cs index 40046e8a..d8c2a80e 100644 --- a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsGetConnection.g.cs +++ b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsGetConnection.g.cs @@ -16,5 +16,17 @@ public partial interface IEnvironmentsClient string deviceId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Environment Connection
+ /// Get a specific environment connection by deviceId + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EnvironmentsGetConnectionAsResponseAsync( + string deviceId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsListConnections.g.cs b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsListConnections.g.cs index e63968c4..d88525fd 100644 --- a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsListConnections.g.cs +++ b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsListConnections.g.cs @@ -22,5 +22,23 @@ public partial interface IEnvironmentsClient string? onlineOnly = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Environment Connections
+ /// List all active environment connections for the organization + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EnvironmentsListConnectionsAsResponseAsync( + string? limit = default, + string? after = default, + string? userId = default, + string? onlineOnly = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsRegister.g.cs b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsRegister.g.cs index 59f6c356..957b779e 100644 --- a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsRegister.g.cs +++ b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsRegister.g.cs @@ -21,6 +21,19 @@ public partial interface IEnvironmentsClient /// Register Environment
/// Register a new listener connection and get connectionId for WebSocket /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EnvironmentsRegisterAsResponseAsync( + + global::Letta.EnvironmentsRegisterRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Register Environment
+ /// Register a new listener connection and get connectionId for WebSocket + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsSendMessage.g.cs b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsSendMessage.g.cs index 275542ed..b1420734 100644 --- a/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsSendMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IEnvironmentsClient.EnvironmentsSendMessage.g.cs @@ -24,6 +24,21 @@ public partial interface IEnvironmentsClient /// Send a message to a specific environment connection /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EnvironmentsSendMessageAsResponseAsync( + string connectionId, + + global::Letta.EnvironmentsSendMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Send Message to Environment
+ /// Send a message to a specific environment connection + ///
+ /// /// /// /// diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsBackfillSubscription.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsBackfillSubscription.g.cs index a3dc234c..1646896e 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsBackfillSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsBackfillSubscription.g.cs @@ -27,6 +27,23 @@ public partial interface IFeedsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsBackfillSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + + global::Letta.FeedsBackfillSubscriptionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Backfill Subscription
+ /// Start a background job to send historical messages to an agent subscription. Returns immediately with workflow ID. Does not update last_consumed_sequence. + ///
+ /// + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsCreateFeed.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsCreateFeed.g.cs index 02491521..bf7ce51c 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsCreateFeed.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsCreateFeed.g.cs @@ -21,6 +21,19 @@ public partial interface IFeedsClient /// Create Feed
/// Create a new feed in a project /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsCreateFeedAsResponseAsync( + + global::Letta.FeedsCreateFeedRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Feed
+ /// Create a new feed in a project + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteFeed.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteFeed.g.cs index 8f8e0087..955b6033 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteFeed.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteFeed.g.cs @@ -24,6 +24,21 @@ public partial interface IFeedsClient /// Soft delete a feed and clean up its sequence /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsDeleteFeedAsResponseAsync( + string feedId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Feed
+ /// Soft delete a feed and clean up its sequence + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteSubscription.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteSubscription.g.cs index 324bb1ec..e8ccec98 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsDeleteSubscription.g.cs @@ -27,6 +27,23 @@ public partial interface IFeedsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsDeleteSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Subscription
+ /// Remove agent subscription from a feed (by subscription_id) + ///
+ /// + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetFeed.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetFeed.g.cs index 1204ffd1..a0bc5a84 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetFeed.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetFeed.g.cs @@ -16,5 +16,17 @@ public partial interface IFeedsClient string feedId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Feed
+ /// Retrieve feed details by ID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsGetFeedAsResponseAsync( + string feedId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetMessage.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetMessage.g.cs index d48410da..9b372dbf 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsGetMessage.g.cs @@ -18,5 +18,19 @@ public partial interface IFeedsClient string messageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Feed Message
+ /// Get full content of a feed message + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsGetMessageAsResponseAsync( + string feedId, + string messageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListFeeds.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListFeeds.g.cs index 7bc2710d..181ec86e 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListFeeds.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListFeeds.g.cs @@ -22,5 +22,23 @@ public partial interface IFeedsClient global::Letta.OneOf? offset = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Feeds
+ /// List all feeds with optional filters and pagination + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsListFeedsAsResponseAsync( + string? projectId = default, + string? name = default, + string? limit = default, + global::Letta.OneOf? offset = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListMessages.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListMessages.g.cs index 00f7899b..157af461 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListMessages.g.cs @@ -20,5 +20,21 @@ public partial interface IFeedsClient string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Feed Messages
+ /// List messages from a feed (for debugging/inspection) + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsListMessagesAsResponseAsync( + string feedId, + string? afterSequence = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptionHistory.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptionHistory.g.cs index fc8f9b64..07f35d9f 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptionHistory.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptionHistory.g.cs @@ -22,5 +22,23 @@ public partial interface IFeedsClient string? nextPageToken = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Subscription History
+ /// List the run history for a subscription including scheduled runs, manual triggers, and backfills. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsListSubscriptionHistoryAsResponseAsync( + string feedId, + string subscriptionId, + string? pageSize = default, + string? nextPageToken = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptions.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptions.g.cs index 9c84d55a..fefb07b6 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptions.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsListSubscriptions.g.cs @@ -22,5 +22,23 @@ public partial interface IFeedsClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Feed Subscriptions
+ /// List all agent subscriptions for a feed + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsListSubscriptionsAsResponseAsync( + string feedId, + string? limit = default, + global::Letta.OneOf? offset = default, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsPublishMessages.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsPublishMessages.g.cs index 59780aa1..8c2bfda7 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsPublishMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsPublishMessages.g.cs @@ -24,6 +24,21 @@ public partial interface IFeedsClient /// Batch insert messages into a feed (up to 10,000 per request) /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsPublishMessagesAsResponseAsync( + string feedId, + + global::Letta.FeedsPublishMessagesRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Publish Messages
+ /// Batch insert messages into a feed (up to 10,000 per request) + ///
+ /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsSubscribeAgent.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsSubscribeAgent.g.cs index bc5a3658..301a80c3 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsSubscribeAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsSubscribeAgent.g.cs @@ -24,6 +24,21 @@ public partial interface IFeedsClient /// Subscribe an agent to a feed with polling configuration /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsSubscribeAgentAsResponseAsync( + string feedId, + + global::Letta.FeedsSubscribeAgentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Subscribe Agent to Feed
+ /// Subscribe an agent to a feed with polling configuration + ///
+ /// /// /// /// diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsTriggerSubscription.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsTriggerSubscription.g.cs index 63695d2d..570c2f87 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsTriggerSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsTriggerSubscription.g.cs @@ -27,6 +27,23 @@ public partial interface IFeedsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsTriggerSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Trigger Subscription
+ /// Immediately trigger a subscription to process pending messages + ///
+ /// + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUnsubscribeAgent.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUnsubscribeAgent.g.cs index 57b9c512..af9426aa 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUnsubscribeAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUnsubscribeAgent.g.cs @@ -24,6 +24,21 @@ public partial interface IFeedsClient /// Remove agent subscription from a feed (by agent_id) /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsUnsubscribeAgentAsResponseAsync( + string feedId, + + global::Letta.FeedsUnsubscribeAgentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unsubscribe Agent from Feed
+ /// Remove agent subscription from a feed (by agent_id) + ///
+ /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs index 1a59c212..fbe9c8d4 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateAllSubscriptionsCron.g.cs @@ -24,6 +24,21 @@ public partial interface IFeedsClient /// Update the cron schedule for all subscriptions of a feed /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsUpdateAllSubscriptionsCronAsResponseAsync( + string feedId, + + global::Letta.FeedsUpdateAllSubscriptionsCronRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update All Subscriptions Cron Schedule
+ /// Update the cron schedule for all subscriptions of a feed + ///
+ /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateSubscription.g.cs b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateSubscription.g.cs index 52c67663..aa11dfcb 100644 --- a/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateSubscription.g.cs +++ b/src/libs/Letta/Generated/Letta.IFeedsClient.FeedsUpdateSubscription.g.cs @@ -27,6 +27,23 @@ public partial interface IFeedsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FeedsUpdateSubscriptionAsResponseAsync( + string feedId, + string subscriptionId, + + global::Letta.FeedsUpdateSubscriptionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Subscription
+ /// Update subscription configuration (cron schedule, enable/disable) + ///
+ /// + /// /// /// /// diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.CountFolders.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.CountFolders.g.cs index f533429f..567fd14a 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.CountFolders.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.CountFolders.g.cs @@ -14,5 +14,15 @@ public partial interface IFoldersClient global::System.Threading.Tasks.Task CountFoldersAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Folders
+ /// Count all data folders created by a user. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CountFoldersAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.CreateFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.CreateFolder.g.cs index e1e0c3b3..94b0bb4a 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.CreateFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.CreateFolder.g.cs @@ -21,6 +21,19 @@ public partial interface IFoldersClient /// Create Folder
/// Create a new data folder. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateFolderAsResponseAsync( + + global::Letta.SourceCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Folder
+ /// Create a new data folder. + ///
/// /// The name of the source. /// diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFileFromFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFileFromFolder.g.cs index 5b2b0ca3..264a1054 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFileFromFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFileFromFolder.g.cs @@ -22,5 +22,23 @@ public partial interface IFoldersClient string fileId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete File From Folder
+ /// Delete a file from a folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteFileFromFolderAsResponseAsync( + string folderId, + string fileId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFolder.g.cs index ca51d176..44f8ef18 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.DeleteFolder.g.cs @@ -18,5 +18,19 @@ public partial interface IFoldersClient string folderId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Folder
+ /// Delete a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteFolderAsResponseAsync( + string folderId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.ListAgentsForFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.ListAgentsForFolder.g.cs index 098e4617..1e73e9d7 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.ListAgentsForFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.ListAgentsForFolder.g.cs @@ -41,5 +41,42 @@ public partial interface IFoldersClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents For Folder
+ /// Get all agent IDs that have the specified folder attached. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsForFolderAsResponseAsync( + string folderId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForFolderOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.ListFilesForFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.ListFilesForFolder.g.cs index 1fbe986b..189f7e76 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.ListFilesForFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.ListFilesForFolder.g.cs @@ -46,5 +46,47 @@ public partial interface IFoldersClient bool? includeContent = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Files For Folder
+ /// List paginated files associated with a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// File ID cursor for pagination. Returns files that come before this file ID in the specified sort order + /// + /// + /// File ID cursor for pagination. Returns files that come after this file ID in the specified sort order + /// + /// + /// Maximum number of files to return
+ /// Default Value: 1000 + /// + /// + /// Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Whether to include full file content
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListFilesForFolderAsResponseAsync( + string folderId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFilesForFolderOrder? order = default, + string? orderBy = default, + bool? includeContent = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolderPassages.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolderPassages.g.cs index f7e0ee35..ee88ec4d 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolderPassages.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolderPassages.g.cs @@ -41,5 +41,42 @@ public partial interface IFoldersClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Folder Passages
+ /// List all passages associated with a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// Passage ID cursor for pagination. Returns passages that come before this passage ID in the specified sort order + /// + /// + /// Passage ID cursor for pagination. Returns passages that come after this passage ID in the specified sort order + /// + /// + /// Maximum number of passages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for passages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListFolderPassagesAsResponseAsync( + string folderId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFolderPassagesOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolders.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolders.g.cs index 24d2fd4a..1b8c2f91 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolders.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.ListFolders.g.cs @@ -41,5 +41,42 @@ public partial interface IFoldersClient string? name = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Folders
+ /// List all data folders created by a user. + ///
+ /// + /// Folder ID cursor for pagination. Returns folders that come before this folder ID in the specified sort order + /// + /// + /// Folder ID cursor for pagination. Returns folders that come after this folder ID in the specified sort order + /// + /// + /// Maximum number of folders to return
+ /// Default Value: 50 + /// + /// + /// Sort order for folders by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Folder name to filter by + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListFoldersAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListFoldersOrder? order = default, + string? orderBy = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.ModifyFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.ModifyFolder.g.cs index 5ce991a2..d2e7d1b1 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.ModifyFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.ModifyFolder.g.cs @@ -28,6 +28,23 @@ public partial interface IFoldersClient /// /// The ID of the source in the format 'source-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyFolderAsResponseAsync( + string folderId, + + global::Letta.SourceUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Folder
+ /// Update the name or documentation of an existing data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// /// /// The name of the source. /// diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFile.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFile.g.cs index b401c42b..ad5e94a9 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFile.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFile.g.cs @@ -27,5 +27,28 @@ public partial interface IFoldersClient bool? includeContent = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve File
+ /// Retrieve a file from a folder by ID. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// The ID of the file in the format 'file-<uuid4>' + /// + /// + /// Whether to include full file content
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveFileAsResponseAsync( + string folderId, + string fileId, + bool? includeContent = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFolder.g.cs index dd9dd121..b3781ead 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveFolder.g.cs @@ -18,5 +18,19 @@ public partial interface IFoldersClient string folderId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Folder
+ /// Get a folder by ID + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveFolderAsResponseAsync( + string folderId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveMetadata.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveMetadata.g.cs index f73808bc..eafde239 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveMetadata.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.RetrieveMetadata.g.cs @@ -23,5 +23,24 @@ public partial interface IFoldersClient bool? includeDetailedPerSourceMetadata = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Metadata
+ /// Get aggregated metadata for all folders in an organization.
+ /// Returns structured metadata including:
+ /// - Total number of folders
+ /// - Total number of files across all folders
+ /// - Total size of all files
+ /// - Per-source breakdown with file details (file_name, file_size per file) if include_detailed_per_source_metadata is True + ///
+ /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveMetadataAsResponseAsync( + bool? includeDetailedPerSourceMetadata = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IFoldersClient.UploadFileToFolder.g.cs b/src/libs/Letta/Generated/Letta.IFoldersClient.UploadFileToFolder.g.cs index a56ac7c0..d7e3bad3 100644 --- a/src/libs/Letta/Generated/Letta.IFoldersClient.UploadFileToFolder.g.cs +++ b/src/libs/Letta/Generated/Letta.IFoldersClient.UploadFileToFolder.g.cs @@ -44,6 +44,32 @@ public partial interface IFoldersClient /// /// Optional custom name to override the uploaded file's name /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadFileToFolderAsResponseAsync( + string folderId, + + global::Letta.BodyUploadFileToFolder request, + global::Letta.DuplicateFileHandling? duplicateHandling = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload File To Folder
+ /// Upload a file to a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// How to handle duplicate filenames
+ /// Default Value: suffix + /// + /// + /// Optional custom name to override the uploaded file's name + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. @@ -57,5 +83,64 @@ public partial interface IFoldersClient string? name = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload File To Folder
+ /// Upload a file to a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// How to handle duplicate filenames
+ /// Default Value: suffix + /// + /// + /// Optional custom name to override the uploaded file's name + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UploadFileToFolderAsync( + string folderId, + global::System.IO.Stream file, + string filename, + global::Letta.DuplicateFileHandling? duplicateHandling = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload File To Folder
+ /// Upload a file to a data folder. + ///
+ /// + /// The ID of the source in the format 'source-<uuid4>' + /// + /// + /// How to handle duplicate filenames
+ /// Default Value: suffix + /// + /// + /// Optional custom name to override the uploaded file's name + /// + /// + /// The stream to send as the multipart 'file' file part. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadFileToFolderAsResponseAsync( + string folderId, + global::System.IO.Stream file, + string filename, + global::Letta.DuplicateFileHandling? duplicateHandling = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IHealthClient.CheckHealth.g.cs b/src/libs/Letta/Generated/Letta.IHealthClient.CheckHealth.g.cs index c8966c6d..209339ee 100644 --- a/src/libs/Letta/Generated/Letta.IHealthClient.CheckHealth.g.cs +++ b/src/libs/Letta/Generated/Letta.IHealthClient.CheckHealth.g.cs @@ -14,5 +14,15 @@ public partial interface IHealthClient global::System.Threading.Tasks.Task CheckHealthAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Check Health
+ /// Liveness endpoint; returns 200 when process is responsive. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CheckHealthAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IHealthClient.CheckReadiness.g.cs b/src/libs/Letta/Generated/Letta.IHealthClient.CheckReadiness.g.cs index f57b8576..18c6bfce 100644 --- a/src/libs/Letta/Generated/Letta.IHealthClient.CheckReadiness.g.cs +++ b/src/libs/Letta/Generated/Letta.IHealthClient.CheckReadiness.g.cs @@ -14,5 +14,15 @@ public partial interface IHealthClient global::System.Threading.Tasks.Task CheckReadinessAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Check Readiness
+ /// Readiness endpoint gated by internal readiness state when enforcement is enabled. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CheckReadinessAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalAgentsClient.CountInternalAgents.g.cs b/src/libs/Letta/Generated/Letta.IInternalAgentsClient.CountInternalAgents.g.cs index 774e29b3..16ede879 100644 --- a/src/libs/Letta/Generated/Letta.IInternalAgentsClient.CountInternalAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalAgentsClient.CountInternalAgents.g.cs @@ -19,5 +19,20 @@ public partial interface IInternalAgentsClient bool? excludeHidden = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Agents
+ /// Get the total number of agents for a user, with option to exclude hidden agents. + ///
+ /// + /// If True, excludes hidden agents from the count. If False, includes all agents.
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CountInternalAgentsAsResponseAsync( + bool? excludeHidden = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.IInternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs index 64e7e615..1001b415 100644 --- a/src/libs/Letta/Generated/Letta.IInternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs @@ -31,6 +31,25 @@ public partial interface IInternalAgentsClient /// /// The ID of the agent in the format 'agent-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyInternalCoreMemoryBlockAsResponseAsync( + string blockLabel, + string agentId, + + global::Letta.BlockUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Block For Agent
+ /// Updates a core memory block of an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// /// /// Value of the block. /// diff --git a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.CreateInternalBlock.g.cs b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.CreateInternalBlock.g.cs index 4341c57a..425a86d3 100644 --- a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.CreateInternalBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.CreateInternalBlock.g.cs @@ -19,6 +19,18 @@ public partial interface IInternalBlocksClient /// /// Create Block /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateInternalBlockAsResponseAsync( + + global::Letta.CreateBlock request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Block + /// /// /// Value of the block. /// diff --git a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.DeleteInternalBlock.g.cs b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.DeleteInternalBlock.g.cs index 35a0931d..b1cd3884 100644 --- a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.DeleteInternalBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.DeleteInternalBlock.g.cs @@ -17,5 +17,18 @@ public partial interface IInternalBlocksClient string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteInternalBlockAsResponseAsync( + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListAgentsForInternalBlock.g.cs b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListAgentsForInternalBlock.g.cs index ba4bcb91..96613406 100644 --- a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListAgentsForInternalBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListAgentsForInternalBlock.g.cs @@ -53,5 +53,52 @@ public partial interface IInternalBlocksClient global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents For Block
+ /// Retrieves all agents associated with the specified block.
+ /// Raises a 404 if the block does not exist. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAgentsForInternalBlockAsResponseAsync( + string blockId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForInternalBlockOrder? order = default, + string? orderBy = default, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListInternalBlocks.g.cs b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListInternalBlocks.g.cs index 60cc196d..dd9ccd6e 100644 --- a/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListInternalBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalBlocksClient.ListInternalBlocks.g.cs @@ -85,5 +85,86 @@ public partial interface IInternalBlocksClient global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Blocks + /// + /// + /// Label to include (alphanumeric, hyphens, underscores, forward slashes) + /// + /// + /// Whether to include only templates
+ /// Default Value: false + /// + /// + /// Name filter (alphanumeric, spaces, hyphens, underscores) + /// + /// + /// The ID of the identity in the format 'identity-<uuid4>' + /// + /// + /// Search agents by identifier keys + /// + /// + /// Search blocks by project id + /// + /// + /// Number of blocks to return
+ /// Default Value: 50 + /// + /// + /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order + /// + /// + /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order + /// + /// + /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Search blocks by label. If provided, returns blocks whose label matches the search query. This is a full-text search on block labels. + /// + /// + /// Search blocks by description. If provided, returns blocks whose description matches the search query. This is a full-text search on block descriptions. + /// + /// + /// Search blocks by value. If provided, returns blocks whose value matches the search query. This is a full-text search on block values. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have more than this number of connected agents. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have less than this number of connected agents. + /// + /// + /// Filter blocks by the exact number of connected agents. If provided, returns blocks that have exactly this number of connected agents. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListInternalBlocksAsResponseAsync( + string? label = default, + bool? templatesOnly = default, + string? name = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + string? projectId = default, + int? limit = default, + string? before = default, + string? after = default, + global::Letta.ListInternalBlocksOrder? order = default, + string? orderBy = default, + string? labelSearch = default, + string? descriptionSearch = default, + string? valueSearch = default, + int? connectedToAgentsCountGt = default, + int? connectedToAgentsCountLt = default, + global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalRunsClient.ListInternalRuns.g.cs b/src/libs/Letta/Generated/Letta.IInternalRunsClient.ListInternalRuns.g.cs index 71982fcd..9aebc339 100644 --- a/src/libs/Letta/Generated/Letta.IInternalRunsClient.ListInternalRuns.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalRunsClient.ListInternalRuns.g.cs @@ -118,5 +118,117 @@ public partial interface IInternalRunsClient global::System.DateTime? endDate = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Runs
+ /// List all runs. + ///
+ /// + /// Filter by a specific run ID. + /// + /// + /// The unique identifier of the agent associated with the run. + /// + /// + /// The unique identifiers of the agents associated with the run. Deprecated in favor of agent_id field. + /// + /// + /// Filter runs by status. Can specify multiple statuses. + /// + /// + /// If True, filters for runs that were created in background mode. + /// + /// + /// Filter runs by stop reason. + /// + /// + /// Filter runs by template family (base_template_id). + /// + /// + /// Filter runs by step count. Must be provided with step_count_operator. + /// + /// + /// Operator for step_count filter: 'eq' for equals, 'gte' for greater than or equal, 'lte' for less than or equal.
+ /// Default Value: eq + /// + /// + /// Filter runs that used any of the specified tools. + /// + /// + /// Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order + /// + /// + /// Run ID cursor for pagination. Returns runs that come after this run ID in the specified sort order + /// + /// + /// Maximum number of runs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter for active runs.
+ /// Default Value: false + /// + /// + /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field.
+ /// Default Value: false + /// + /// + /// Filter runs by project ID. + /// + /// + /// Filter runs by conversation ID. + /// + /// + /// Filter runs by duration percentile (1-100). Returns runs slower than this percentile. + /// + /// + /// Duration value in nanoseconds for filtering. Must be used with duration_operator. + /// + /// + /// Comparison operator for duration filter: 'gt' (greater than), 'lt' (less than), 'eq' (equals). + /// + /// + /// Filter runs created on or after this date (ISO 8601 format). + /// + /// + /// Filter runs created on or before this date (ISO 8601 format). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListInternalRunsAsResponseAsync( + string? runId = default, + string? agentId = default, + global::System.Collections.Generic.IList? agentIds = default, + global::System.Collections.Generic.IList? statuses = default, + bool? background = default, + global::Letta.StopReasonType? stopReason = default, + string? templateFamily = default, + int? stepCount = default, + global::Letta.ComparisonOperator? stepCountOperator = default, + global::System.Collections.Generic.IList? toolsUsed = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListInternalRunsOrder? order = default, + global::Letta.ListInternalRunsOrderBy? orderBy = default, + bool? active = default, + bool? ascending = default, + string? projectId = default, + string? conversationId = default, + int? durationPercentile = default, + int? durationValue = default, + global::Letta.ListInternalRunsDurationOperator2? durationOperator = default, + global::System.DateTime? startDate = default, + global::System.DateTime? endDate = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateAgent.g.cs b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateAgent.g.cs index 68c29292..978683ba 100644 --- a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateAgent.g.cs @@ -23,6 +23,19 @@ public partial interface IInternalTemplatesClient /// Create Agent
/// Create a new agent with template-related fields. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateInternalTemplateAgentAsResponseAsync( + + global::Letta.InternalTemplateAgentCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agent
+ /// Create a new agent with template-related fields. + ///
/// /// The name of the agent. /// diff --git a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlock.g.cs b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlock.g.cs index f3478640..9a5dd841 100644 --- a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlock.g.cs @@ -21,6 +21,19 @@ public partial interface IInternalTemplatesClient /// Create Block
/// Create a new block with template-related fields. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateInternalTemplateBlockAsResponseAsync( + + global::Letta.InternalTemplateBlockCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Block
+ /// Create a new block with template-related fields. + ///
/// /// Value of the block. /// diff --git a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs index 1898f194..6be65dc8 100644 --- a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs @@ -14,6 +14,19 @@ public partial interface IInternalTemplatesClient /// global::System.Threading.Tasks.Task> CreateInternalTemplateBlocksBatchAsync( + global::System.Collections.Generic.IList request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Blocks Batch
+ /// Create multiple blocks with template-related fields. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> CreateInternalTemplateBlocksBatchAsResponseAsync( + global::System.Collections.Generic.IList request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateGroup.g.cs b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateGroup.g.cs index 719a2876..77db27fa 100644 --- a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateGroup.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.CreateInternalTemplateGroup.g.cs @@ -23,6 +23,19 @@ public partial interface IInternalTemplatesClient /// Create Group
/// Create a new multi-agent group with the specified configuration. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateInternalTemplateGroupAsResponseAsync( + + global::Letta.InternalTemplateGroupCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Group
+ /// Create a new multi-agent group with the specified configuration. + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.DeleteDeployment.g.cs b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.DeleteDeployment.g.cs index 4268d7b7..bb2b596e 100644 --- a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.DeleteDeployment.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.DeleteDeployment.g.cs @@ -17,5 +17,18 @@ public partial interface IInternalTemplatesClient string deploymentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Deployment
+ /// Delete all entities (blocks, agents, groups) with the specified deployment_id.
+ /// Deletion order: blocks -> agents -> groups to maintain referential integrity. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteDeploymentAsResponseAsync( + string deploymentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.ListDeploymentEntities.g.cs b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.ListDeploymentEntities.g.cs index aeeaec41..a6162536 100644 --- a/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.ListDeploymentEntities.g.cs +++ b/src/libs/Letta/Generated/Letta.IInternalTemplatesClient.ListDeploymentEntities.g.cs @@ -21,5 +21,22 @@ public partial interface IInternalTemplatesClient global::System.Collections.Generic.IList? entityTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Deployment Entities
+ /// List all entities (blocks, agents, groups) with the specified deployment_id.
+ /// Optionally filter by entity types. + ///
+ /// + /// + /// Filter by entity types (block, agent, group) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListDeploymentEntitiesAsResponseAsync( + string deploymentId, + global::System.Collections.Generic.IList? entityTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IJobsClient.CancelJob.g.cs b/src/libs/Letta/Generated/Letta.IJobsClient.CancelJob.g.cs index f5ff35b2..afaca998 100644 --- a/src/libs/Letta/Generated/Letta.IJobsClient.CancelJob.g.cs +++ b/src/libs/Letta/Generated/Letta.IJobsClient.CancelJob.g.cs @@ -20,5 +20,21 @@ public partial interface IJobsClient string jobId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel Job
+ /// Cancel a job by its job_id.
+ /// This endpoint marks a job as cancelled, which will cause any associated
+ /// agent execution to terminate as soon as possible. + ///
+ /// + /// The ID of the job in the format 'job-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelJobAsResponseAsync( + string jobId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IJobsClient.DeleteJob.g.cs b/src/libs/Letta/Generated/Letta.IJobsClient.DeleteJob.g.cs index 9c33483c..6989a7ae 100644 --- a/src/libs/Letta/Generated/Letta.IJobsClient.DeleteJob.g.cs +++ b/src/libs/Letta/Generated/Letta.IJobsClient.DeleteJob.g.cs @@ -18,5 +18,19 @@ public partial interface IJobsClient string jobId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Job
+ /// Delete a job by its job_id. + ///
+ /// + /// The ID of the job in the format 'job-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteJobAsResponseAsync( + string jobId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IJobsClient.ListJobs.g.cs b/src/libs/Letta/Generated/Letta.IJobsClient.ListJobs.g.cs index 60aae6bc..d464e6e4 100644 --- a/src/libs/Letta/Generated/Letta.IJobsClient.ListJobs.g.cs +++ b/src/libs/Letta/Generated/Letta.IJobsClient.ListJobs.g.cs @@ -53,5 +53,52 @@ public partial interface IJobsClient bool? ascending = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Jobs
+ /// List all jobs. + ///
+ /// + /// Deprecated: Use `folder_id` parameter instead. Only list jobs associated with the source. + /// + /// + /// Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order + /// + /// + /// Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order + /// + /// + /// Maximum number of jobs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter for active jobs.
+ /// Default Value: false + /// + /// + /// Whether to sort jobs oldest to newest (True, default) or newest to oldest (False). Deprecated in favor of order field.
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListJobsAsResponseAsync( + string? sourceId = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListJobsOrder? order = default, + string? orderBy = default, + bool? active = default, + bool? ascending = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IJobsClient.RetrieveJob.g.cs b/src/libs/Letta/Generated/Letta.IJobsClient.RetrieveJob.g.cs index dfc080c5..c9ea0fef 100644 --- a/src/libs/Letta/Generated/Letta.IJobsClient.RetrieveJob.g.cs +++ b/src/libs/Letta/Generated/Letta.IJobsClient.RetrieveJob.g.cs @@ -18,5 +18,19 @@ public partial interface IJobsClient string jobId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Job
+ /// Get the status of a job. + ///
+ /// + /// The ID of the job in the format 'job-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveJobAsResponseAsync( + string jobId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpConnectMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpConnectMcpServer.g.cs index 3f231df6..ebbd9eb2 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpConnectMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpConnectMcpServer.g.cs @@ -17,5 +17,18 @@ public partial interface IMcpServersClient string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Connect Mcp Server
+ /// Connect to an MCP server with support for OAuth via SSE.
+ /// Returns a stream of events handling authorization state and exchange if OAuth is required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> McpConnectMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpCreateMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpCreateMcpServer.g.cs index 56f3724f..2a0b28ad 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpCreateMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpCreateMcpServer.g.cs @@ -21,6 +21,19 @@ public partial interface IMcpServersClient /// Create Mcp Server
/// Add a new MCP server to the Letta MCP server config /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> McpCreateMcpServerAsResponseAsync( + + global::Letta.CreateMCPServerRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Mcp Server
+ /// Add a new MCP server to the Letta MCP server config + ///
/// /// The name of the MCP server /// diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpDeleteMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpDeleteMcpServer.g.cs index 69f26827..511c8ef5 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpDeleteMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpDeleteMcpServer.g.cs @@ -16,5 +16,17 @@ public partial interface IMcpServersClient string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Mcp Server
+ /// Delete an MCP server by its ID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task McpDeleteMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListMcpServers.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListMcpServers.g.cs index 8493fd37..46d830a7 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListMcpServers.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListMcpServers.g.cs @@ -14,5 +14,15 @@ public partial interface IMcpServersClient global::System.Threading.Tasks.Task>> McpListMcpServersAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Mcp Servers
+ /// Get a list of all configured MCP servers + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>>> McpListMcpServersAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListToolsForMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListToolsForMcpServer.g.cs index 121376e5..434d256d 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListToolsForMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpListToolsForMcpServer.g.cs @@ -16,5 +16,17 @@ public partial interface IMcpServersClient string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Tools For Mcp Server
+ /// Get a list of all tools for a specific MCP server + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> McpListToolsForMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRefreshMcpServerTools.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRefreshMcpServerTools.g.cs index ec07161b..fe1469c2 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRefreshMcpServerTools.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRefreshMcpServerTools.g.cs @@ -23,5 +23,24 @@ public partial interface IMcpServersClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Refresh Mcp Server Tools
+ /// Refresh tools for an MCP server by:
+ /// 1. Fetching current tools from the MCP server
+ /// 2. Deleting tools that no longer exist on the server
+ /// 3. Updating schemas for existing tools
+ /// 4. Adding new tools from the server
+ /// Returns a summary of changes made. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> McpRefreshMcpServerToolsAsResponseAsync( + string mcpServerId, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpServer.g.cs index dd5f43fa..472014a0 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpServer.g.cs @@ -16,5 +16,17 @@ public partial interface IMcpServersClient string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Mcp Server
+ /// Get a specific MCP server + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> McpRetrieveMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpTool.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpTool.g.cs index 17418223..a74324dc 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRetrieveMcpTool.g.cs @@ -18,5 +18,19 @@ public partial interface IMcpServersClient string toolId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Mcp Tool
+ /// Get a specific MCP tool by its ID + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> McpRetrieveMcpToolAsResponseAsync( + string mcpServerId, + string toolId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRunTool.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRunTool.g.cs index a554705f..70748d25 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRunTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpRunTool.g.cs @@ -29,6 +29,24 @@ public partial interface IMcpServersClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> McpRunToolAsResponseAsync( + string mcpServerId, + string toolId, + + global::Letta.LettaSchemasMcpServerToolExecuteRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Mcp Tool
+ /// Execute a specific MCP tool
+ /// The request body should contain the tool arguments in the ToolExecuteRequest format. + ///
+ /// + /// /// /// Arguments to pass to the tool /// diff --git a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpUpdateMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpUpdateMcpServer.g.cs index fb867200..56c552ee 100644 --- a/src/libs/Letta/Generated/Letta.IMcpServersClient.McpUpdateMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IMcpServersClient.McpUpdateMcpServer.g.cs @@ -24,6 +24,21 @@ public partial interface IMcpServersClient /// Update an existing MCP server configuration /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> McpUpdateMcpServerAsResponseAsync( + string mcpServerId, + + global::Letta.UpdateMCPServerRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Mcp Server
+ /// Update an existing MCP server configuration + ///
+ /// /// /// The name of the MCP server /// diff --git a/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesGetFileHistory.g.cs b/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesGetFileHistory.g.cs index 9122796b..626f52f4 100644 --- a/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesGetFileHistory.g.cs +++ b/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesGetFileHistory.g.cs @@ -20,5 +20,21 @@ public partial interface IMemoryFilesClient double? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File History
+ /// Get commit history for a specific file in the agent memory repo. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MemoryFilesGetFileHistoryAsResponseAsync( + string agentId, + string filePath, + double? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesListDirectory.g.cs b/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesListDirectory.g.cs index beb21e2f..7fcc93aa 100644 --- a/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesListDirectory.g.cs +++ b/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesListDirectory.g.cs @@ -22,5 +22,23 @@ public partial interface IMemoryFilesClient string? @ref = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Directory
+ /// List immediate children of a directory in the agent memory repo (single level). + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MemoryFilesListDirectoryAsResponseAsync( + string agentId, + string? path = default, + double? depth = default, + string? @ref = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesReadFileContent.g.cs b/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesReadFileContent.g.cs index d740acbc..23bf7411 100644 --- a/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesReadFileContent.g.cs +++ b/src/libs/Letta/Generated/Letta.IMemoryFilesClient.MemoryFilesReadFileContent.g.cs @@ -20,5 +20,21 @@ public partial interface IMemoryFilesClient string? @ref = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Read File Content
+ /// Read a single file content at a specific git ref from the agent memory repo. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MemoryFilesReadFileContentAsResponseAsync( + string agentId, + string filePath, + string? @ref = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.CancelBatch.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.CancelBatch.g.cs index ce9a1b83..15f19af5 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.CancelBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.CancelBatch.g.cs @@ -16,5 +16,17 @@ public partial interface IMessagesClient string batchId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel Batch
+ /// Cancel a batch run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelBatchAsResponseAsync( + string batchId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.CreateBatch.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.CreateBatch.g.cs index d42ee789..36cd2190 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.CreateBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.CreateBatch.g.cs @@ -25,6 +25,21 @@ public partial interface IMessagesClient /// Creates a job that will fan out messages to all listed agents and process them in parallel.
/// The request will be rejected if it exceeds 256MB. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateBatchAsResponseAsync( + + global::Letta.CreateBatch request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Batch
+ /// Submit a batch of agent runs for asynchronous processing.
+ /// Creates a job that will fan out messages to all listed agents and process them in parallel.
+ /// The request will be rejected if it exceeds 256MB. + ///
/// /// List of requests to be processed in batch. /// diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.ListAllMessages.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.ListAllMessages.g.cs index e08ea93f..0d65f281 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.ListAllMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.ListAllMessages.g.cs @@ -40,5 +40,41 @@ public partial interface IMessagesClient global::System.Collections.Generic.IList? includeReturnMessageTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List All Messages
+ /// List messages across all agents for the current user. + ///
+ /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Conversation ID to filter messages by + /// + /// + /// Message types to include in response. When null, all message types are returned. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListAllMessagesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAllMessagesOrder? order = default, + string? conversationId = default, + global::System.Collections.Generic.IList? includeReturnMessageTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.ListBatches.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.ListBatches.g.cs index 37125a30..bb0fc665 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.ListBatches.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.ListBatches.g.cs @@ -37,5 +37,38 @@ public partial interface IMessagesClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Batches
+ /// List all batch runs. + ///
+ /// + /// Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order + /// + /// + /// Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order + /// + /// + /// Maximum number of jobs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListBatchesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListBatchesOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.ListMessagesForBatch.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.ListMessagesForBatch.g.cs index f877fcef..3a1276c8 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.ListMessagesForBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.ListMessagesForBatch.g.cs @@ -43,5 +43,44 @@ public partial interface IMessagesClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Messages For Batch
+ /// Get response messages for a specific batch job. + ///
+ /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter messages by agent ID + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListMessagesForBatchAsResponseAsync( + string batchId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesForBatchOrder? order = default, + string? orderBy = default, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveBatch.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveBatch.g.cs index 0bab0d5a..5b7aa02c 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveBatch.g.cs @@ -16,5 +16,17 @@ public partial interface IMessagesClient string batchId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Batch
+ /// Retrieve the status and details of a batch run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveBatchAsResponseAsync( + string batchId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveMessage.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveMessage.g.cs index 29af7c00..89b0fa7a 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.RetrieveMessage.g.cs @@ -18,5 +18,19 @@ public partial interface IMessagesClient string messageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Message
+ /// Retrieve a message by ID. + ///
+ /// + /// The ID of the message in the format 'message-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> RetrieveMessageAsResponseAsync( + string messageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMessagesClient.SearchAllMessages.g.cs b/src/libs/Letta/Generated/Letta.IMessagesClient.SearchAllMessages.g.cs index a50e0d0a..a419e52a 100644 --- a/src/libs/Letta/Generated/Letta.IMessagesClient.SearchAllMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IMessagesClient.SearchAllMessages.g.cs @@ -25,6 +25,21 @@ public partial interface IMessagesClient /// Returns messages with FTS/vector ranks and total RRF score.
/// This is a cloud-only feature. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> SearchAllMessagesAsResponseAsync( + + global::Letta.SearchAllMessagesRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search All Messages
+ /// Search messages across the organization with optional agent filtering.
+ /// Returns messages with FTS/vector ranks and total RRF score.
+ /// This is a cloud-only feature. + ///
/// /// Text query for full-text search /// diff --git a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetStatus.g.cs b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetStatus.g.cs index c9d451a0..e6e8e298 100644 --- a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetStatus.g.cs +++ b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetStatus.g.cs @@ -13,5 +13,14 @@ public partial interface IMetadataClient global::System.Threading.Tasks.Task MetadataGetStatusAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gets your Letta Cloud status + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MetadataGetStatusAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetUser.g.cs b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetUser.g.cs index 5f94fee1..1f0423ac 100644 --- a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetUser.g.cs +++ b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataGetUser.g.cs @@ -14,5 +14,15 @@ public partial interface IMetadataClient global::System.Threading.Tasks.Task MetadataGetUserAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get current user information
+ /// Retrieve information about the current authenticated user including email, name, organization, and current project. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MetadataGetUserAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataRetrieveCurrentBalances.g.cs b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataRetrieveCurrentBalances.g.cs index dea4583b..2a593e76 100644 --- a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataRetrieveCurrentBalances.g.cs +++ b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataRetrieveCurrentBalances.g.cs @@ -14,5 +14,15 @@ public partial interface IMetadataClient global::System.Threading.Tasks.Task MetadataRetrieveCurrentBalancesAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve current organization balance
+ /// Retrieve the current usage balances for the organization. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MetadataRetrieveCurrentBalancesAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendFeedback.g.cs b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendFeedback.g.cs index a445e59b..dc2e723b 100644 --- a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendFeedback.g.cs +++ b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendFeedback.g.cs @@ -21,6 +21,19 @@ public partial interface IMetadataClient /// Send user feedback
/// Send feedback from users to improve our services. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MetadataSendFeedbackAsResponseAsync( + + global::Letta.MetadataSendFeedbackRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Send user feedback
+ /// Send feedback from users to improve our services. + ///
/// /// /// Default Value: letta-code diff --git a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendTelemetry.g.cs b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendTelemetry.g.cs index 2a9882fa..b82571d4 100644 --- a/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendTelemetry.g.cs +++ b/src/libs/Letta/Generated/Letta.IMetadataClient.MetadataSendTelemetry.g.cs @@ -21,6 +21,19 @@ public partial interface IMetadataClient /// Send telemetry event
/// Send telemetry events for usage tracking and analysis. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> MetadataSendTelemetryAsResponseAsync( + + global::Letta.MetadataSendTelemetryRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Send telemetry event
+ /// Send telemetry events for usage tracking and analysis. + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IModelsClient.ListEmbeddingModels.g.cs b/src/libs/Letta/Generated/Letta.IModelsClient.ListEmbeddingModels.g.cs index 4647448e..cb7a8f16 100644 --- a/src/libs/Letta/Generated/Letta.IModelsClient.ListEmbeddingModels.g.cs +++ b/src/libs/Letta/Generated/Letta.IModelsClient.ListEmbeddingModels.g.cs @@ -16,5 +16,17 @@ public partial interface IModelsClient global::System.Threading.Tasks.Task> ListEmbeddingModelsAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Embedding Models
+ /// List available embedding models using the asynchronous implementation for improved performance.
+ /// Returns EmbeddingModel format which extends EmbeddingConfig with additional metadata fields.
+ /// Legacy EmbeddingConfig fields are marked as deprecated but still available for backward compatibility. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListEmbeddingModelsAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IModelsClient.ListModels.g.cs b/src/libs/Letta/Generated/Letta.IModelsClient.ListModels.g.cs index 3a279f1e..c22ff7dd 100644 --- a/src/libs/Letta/Generated/Letta.IModelsClient.ListModels.g.cs +++ b/src/libs/Letta/Generated/Letta.IModelsClient.ListModels.g.cs @@ -22,5 +22,23 @@ public partial interface IModelsClient global::Letta.ProviderType? providerType = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Llm Models
+ /// List available LLM models using the asynchronous implementation for improved performance.
+ /// Returns Model format which extends LLMConfig with additional metadata fields.
+ /// Legacy LLMConfig fields are marked as deprecated but still available for backward compatibility. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListModelsAsResponseAsync( + global::System.Collections.Generic.IList? providerCategory = default, + string? providerName = default, + global::Letta.ProviderType? providerType = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IModelsClient.ModelsListEmbeddingModels.g.cs b/src/libs/Letta/Generated/Letta.IModelsClient.ModelsListEmbeddingModels.g.cs index 7255f3f5..65d37c9e 100644 --- a/src/libs/Letta/Generated/Letta.IModelsClient.ModelsListEmbeddingModels.g.cs +++ b/src/libs/Letta/Generated/Letta.IModelsClient.ModelsListEmbeddingModels.g.cs @@ -13,5 +13,14 @@ public partial interface IModelsClient global::System.Threading.Tasks.Task ModelsListEmbeddingModelsAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ModelsListEmbeddingModelsAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IPassagesClient.SearchPassages.g.cs b/src/libs/Letta/Generated/Letta.IPassagesClient.SearchPassages.g.cs index fc022d70..4180c4c7 100644 --- a/src/libs/Letta/Generated/Letta.IPassagesClient.SearchPassages.g.cs +++ b/src/libs/Letta/Generated/Letta.IPassagesClient.SearchPassages.g.cs @@ -33,6 +33,25 @@ public partial interface IPassagesClient /// - If archive_id is provided, searches passages within that specific archive
/// - If both are provided, agent_id takes precedence /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> SearchPassagesAsResponseAsync( + + global::Letta.PassageSearchRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search Passages
+ /// Search passages across the organization with optional agent and archive filtering.
+ /// Returns passages with relevance scores.
+ /// This endpoint supports semantic search through passages:
+ /// - If neither agent_id nor archive_id is provided, searches ALL passages in the organization
+ /// - If agent_id is provided, searches passages across all archives attached to that agent
+ /// - If archive_id is provided, searches passages within that specific archive
+ /// - If both are provided, agent_id takes precedence + ///
/// /// Text query for semantic search /// diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCountPipelines.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCountPipelines.g.cs index 29e1d549..14c5c738 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCountPipelines.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCountPipelines.g.cs @@ -20,5 +20,21 @@ public partial interface IPipelinesClient string? integrationId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Pipelines
+ /// Get the total count of pipelines, optionally filtered by project and search + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesCountPipelinesAsResponseAsync( + string? search = default, + string? integrationType = default, + string? integrationId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCreatePipeline.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCreatePipeline.g.cs index e8168829..54072d3c 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCreatePipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesCreatePipeline.g.cs @@ -21,6 +21,19 @@ public partial interface IPipelinesClient /// Create Pipeline
/// Create a new pipeline (producer + feed + optionally subscribers) /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesCreatePipelineAsResponseAsync( + + global::Letta.PipelinesCreatePipelineRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Pipeline
+ /// Create a new pipeline (producer + feed + optionally subscribers) + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesDeletePipeline.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesDeletePipeline.g.cs index a8b492cc..3b10f2fe 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesDeletePipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesDeletePipeline.g.cs @@ -24,6 +24,21 @@ public partial interface IPipelinesClient /// Soft delete a pipeline and cascade to feed + subscriptions /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesDeletePipelineAsResponseAsync( + string pipelineId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Pipeline
+ /// Soft delete a pipeline and cascade to feed + subscriptions + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesGetPipeline.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesGetPipeline.g.cs index f994ac1e..e3a939c1 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesGetPipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesGetPipeline.g.cs @@ -16,5 +16,17 @@ public partial interface IPipelinesClient string pipelineId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Pipeline
+ /// Get a single pipeline with details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesGetPipelineAsResponseAsync( + string pipelineId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelineSyncHistory.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelineSyncHistory.g.cs index 311dffd6..353b5def 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelineSyncHistory.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelineSyncHistory.g.cs @@ -16,5 +16,17 @@ public partial interface IPipelinesClient string pipelineId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Pipeline Sync History
+ /// List the sync run history for a pipeline from Temporal with error details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesListPipelineSyncHistoryAsResponseAsync( + string pipelineId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelines.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelines.g.cs index 85b8e173..8cf78fce 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelines.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesListPipelines.g.cs @@ -24,5 +24,25 @@ public partial interface IPipelinesClient string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Pipelines
+ /// List all pipelines for the organization with optional filtering + ///
+ /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesListPipelinesAsResponseAsync( + string? search = default, + string? integrationType = default, + string? integrationId = default, + global::Letta.OneOf? offset = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesPreviewPipeline.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesPreviewPipeline.g.cs index 9c257fa7..0afd1e6c 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesPreviewPipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesPreviewPipeline.g.cs @@ -21,6 +21,19 @@ public partial interface IPipelinesClient /// Preview Pipeline
/// Fetch sample messages from integration to preview what agents will receive /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesPreviewPipelineAsResponseAsync( + + global::Letta.PipelinesPreviewPipelineRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Preview Pipeline
+ /// Fetch sample messages from integration to preview what agents will receive + ///
/// /// /// diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesSyncPipeline.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesSyncPipeline.g.cs index 16ce3595..d8b068e2 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesSyncPipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesSyncPipeline.g.cs @@ -24,6 +24,21 @@ public partial interface IPipelinesClient /// Manually trigger a pipeline sync to fetch new messages immediately /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesSyncPipelineAsResponseAsync( + string pipelineId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Sync Pipeline
+ /// Manually trigger a pipeline sync to fetch new messages immediately + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipeline.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipeline.g.cs index eefaaf77..80895d36 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipeline.g.cs @@ -24,6 +24,21 @@ public partial interface IPipelinesClient /// Update pipeline name or disable/enable it /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesUpdatePipelineAsResponseAsync( + string pipelineId, + + global::Letta.PipelinesUpdatePipelineRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Pipeline
+ /// Update pipeline name or disable/enable it + ///
+ /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs index f5498318..de9c5989 100644 --- a/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs +++ b/src/libs/Letta/Generated/Letta.IPipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs @@ -24,6 +24,21 @@ public partial interface IPipelinesClient /// Update the producer configuration for a pipeline (e.g., Slack channels) /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PipelinesUpdatePipelineProducerConfigAsResponseAsync( + string pipelineId, + + global::Letta.PipelinesUpdatePipelineProducerConfigRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Pipeline Producer Config
+ /// Update the producer configuration for a pipeline (e.g., Slack channels) + ///
+ /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsCreateProject.g.cs b/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsCreateProject.g.cs index 544ea941..e8bdd212 100644 --- a/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsCreateProject.g.cs +++ b/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsCreateProject.g.cs @@ -21,6 +21,19 @@ public partial interface IProjectsClient /// Create Project (Cloud-only)
/// Create a new project /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProjectsCreateProjectAsResponseAsync( + + global::Letta.ProjectsCreateProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Project (Cloud-only)
+ /// Create a new project + ///
/// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsDeleteProject.g.cs b/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsDeleteProject.g.cs index 16b346e3..8f10f304 100644 --- a/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsDeleteProject.g.cs +++ b/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsDeleteProject.g.cs @@ -24,6 +24,21 @@ public partial interface IProjectsClient /// Delete a project by ID /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProjectsDeleteProjectAsResponseAsync( + global::System.Guid projectId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Project (Cloud-only)
+ /// Delete a project by ID + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsListProjects.g.cs b/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsListProjects.g.cs index af7f93c8..06ae277c 100644 --- a/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsListProjects.g.cs +++ b/src/libs/Letta/Generated/Letta.IProjectsClient.ProjectsListProjects.g.cs @@ -20,5 +20,21 @@ public partial interface IProjectsClient string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Projects (Cloud-only)
+ /// List all projects + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ProjectsListProjectsAsResponseAsync( + string? name = default, + global::Letta.OneOf? offset = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.CheckExistingProvider.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.CheckExistingProvider.g.cs index b141580d..916a0c64 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.CheckExistingProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.CheckExistingProvider.g.cs @@ -18,5 +18,19 @@ public partial interface IProvidersClient string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Check Existing Provider
+ /// Verify the API key and additional parameters for an existing provider. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CheckExistingProviderAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.CheckProvider.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.CheckProvider.g.cs index 4ea17b17..eabd746e 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.CheckProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.CheckProvider.g.cs @@ -21,6 +21,19 @@ public partial interface IProvidersClient /// Check Provider
/// Verify the API key and additional parameters for a provider. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CheckProviderAsResponseAsync( + + global::Letta.ProviderCheck request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Check Provider
+ /// Verify the API key and additional parameters for a provider. + ///
/// /// The type of the provider. /// diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.CreateProvider.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.CreateProvider.g.cs index 63d8dfee..0c94c87a 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.CreateProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.CreateProvider.g.cs @@ -21,6 +21,19 @@ public partial interface IProvidersClient /// Create Provider
/// Create a new custom provider. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateProviderAsResponseAsync( + + global::Letta.ProviderCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Provider
+ /// Create a new custom provider. + ///
/// /// The name of the provider. /// diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.DeleteProvider.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.DeleteProvider.g.cs index 39ec937c..4f92cada 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.DeleteProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.DeleteProvider.g.cs @@ -18,5 +18,19 @@ public partial interface IProvidersClient string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Provider
+ /// Delete an existing custom provider. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteProviderAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.ListProviders.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.ListProviders.g.cs index d00d7857..5bef0bc3 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.ListProviders.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.ListProviders.g.cs @@ -45,5 +45,46 @@ public partial interface IProvidersClient global::Letta.ProviderType? providerType = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Providers
+ /// Get a list of all custom providers. + ///
+ /// + /// Provider ID cursor for pagination. Returns providers that come before this provider ID in the specified sort order + /// + /// + /// Provider ID cursor for pagination. Returns providers that come after this provider ID in the specified sort order + /// + /// + /// Maximum number of providers to return
+ /// Default Value: 50 + /// + /// + /// Sort order for providers by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter providers by name + /// + /// + /// Filter providers by type + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListProvidersAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListProvidersOrder? order = default, + string? orderBy = default, + string? name = default, + global::Letta.ProviderType? providerType = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.ModifyProvider.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.ModifyProvider.g.cs index 321ea6e1..54b1fc19 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.ModifyProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.ModifyProvider.g.cs @@ -28,6 +28,23 @@ public partial interface IProvidersClient /// /// The ID of the provider in the format 'provider-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyProviderAsResponseAsync( + string providerId, + + global::Letta.ProviderUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Provider
+ /// Update an existing custom provider. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// /// /// API key or secret key used for requests to the provider. /// diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.RefreshProviderModels.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.RefreshProviderModels.g.cs index b43edbd9..4a0143f0 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.RefreshProviderModels.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.RefreshProviderModels.g.cs @@ -19,5 +19,20 @@ public partial interface IProvidersClient string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Refresh Provider Models
+ /// Refresh models for a BYOK provider by querying the provider's API.
+ /// Adds new models and removes ones no longer available. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RefreshProviderModelsAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IProvidersClient.RetrieveProvider.g.cs b/src/libs/Letta/Generated/Letta.IProvidersClient.RetrieveProvider.g.cs index 611fe7ab..f4c6016b 100644 --- a/src/libs/Letta/Generated/Letta.IProvidersClient.RetrieveProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.IProvidersClient.RetrieveProvider.g.cs @@ -18,5 +18,19 @@ public partial interface IProvidersClient string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Provider
+ /// Get a provider by ID. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveProviderAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.DeleteRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.DeleteRun.g.cs index 280a078f..f95a1fdc 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.DeleteRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.DeleteRun.g.cs @@ -16,5 +16,17 @@ public partial interface IRunsClient string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Run
+ /// Delete a run by its run_id. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.ListMessagesForRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.ListMessagesForRun.g.cs index 2e6a0793..2555a934 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.ListMessagesForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.ListMessagesForRun.g.cs @@ -39,5 +39,40 @@ public partial interface IRunsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Messages For Run
+ /// Get response messages associated with a run. + ///
+ /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListMessagesForRunAsResponseAsync( + string runId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesForRunOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.ListRuns.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.ListRuns.g.cs index e6003732..79e2f25c 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.ListRuns.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.ListRuns.g.cs @@ -73,5 +73,72 @@ public partial interface IRunsClient bool? ascending = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Runs
+ /// List all runs. + ///
+ /// + /// The unique identifier of the agent associated with the run. + /// + /// + /// The unique identifiers of the agents associated with the run. Deprecated in favor of agent_id field. + /// + /// + /// Filter runs by status. Can specify multiple statuses. + /// + /// + /// If True, filters for runs that were created in background mode. + /// + /// + /// Filter runs by stop reason. + /// + /// + /// Filter runs by conversation ID. + /// + /// + /// Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order + /// + /// + /// Run ID cursor for pagination. Returns runs that come after this run ID in the specified sort order + /// + /// + /// Maximum number of runs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter for active runs.
+ /// Default Value: false + /// + /// + /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListRunsAsResponseAsync( + string? agentId = default, + global::System.Collections.Generic.IList? agentIds = default, + global::System.Collections.Generic.IList? statuses = default, + bool? background = default, + global::Letta.StopReasonType? stopReason = default, + string? conversationId = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListRunsOrder? order = default, + string? orderBy = default, + bool? active = default, + bool? ascending = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.ListStepsForRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.ListStepsForRun.g.cs index 19ca6b67..36493892 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.ListStepsForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.ListStepsForRun.g.cs @@ -39,5 +39,40 @@ public partial interface IRunsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Steps For Run
+ /// Get steps associated with a run with filtering options. + ///
+ /// + /// + /// Cursor for pagination + /// + /// + /// Cursor for pagination + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for steps by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListStepsForRunAsResponseAsync( + string runId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListStepsForRunOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveMetricsForRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveMetricsForRun.g.cs index ac1493e8..b198b1ad 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveMetricsForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveMetricsForRun.g.cs @@ -16,5 +16,17 @@ public partial interface IRunsClient string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Metrics For Run
+ /// Get run metrics by run ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveMetricsForRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveRun.g.cs index 898e47a6..2c7cd4e9 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveRun.g.cs @@ -16,5 +16,17 @@ public partial interface IRunsClient string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Run
+ /// Get the status of a run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveStreamForRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveStreamForRun.g.cs index 2107669c..1d794eca 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveStreamForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveStreamForRun.g.cs @@ -22,6 +22,20 @@ public partial interface IRunsClient /// Retrieve Stream For Run /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveStreamForRunAsResponseAsync( + string runId, + + global::Letta.RetrieveStreamRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Stream For Run + /// + /// /// /// Agent ID for agent-direct mode with 'default' conversation. Use with conversation_id='default' in the URL path. /// diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveTraceForRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveTraceForRun.g.cs index f2ed95f2..9ed63b66 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveTraceForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveTraceForRun.g.cs @@ -27,5 +27,28 @@ public partial interface IRunsClient int? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Trace For Run
+ /// Retrieve OTEL trace spans for a run.
+ /// Returns a filtered set of spans relevant for observability:
+ /// - agent_step: Individual agent reasoning steps
+ /// - tool executions: Tool call spans
+ /// - Root span: The top-level request span
+ /// - time_to_first_token: TTFT measurement span
+ /// Requires ClickHouse to be configured for trace storage. + ///
+ /// + /// + /// Maximum number of spans to return
+ /// Default Value: 1000 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> RetrieveTraceForRunAsResponseAsync( + string runId, + int? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveUsageForRun.g.cs b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveUsageForRun.g.cs index f743cd13..dc5b9881 100644 --- a/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveUsageForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.IRunsClient.RetrieveUsageForRun.g.cs @@ -16,5 +16,17 @@ public partial interface IRunsClient string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Usage For Run
+ /// Get usage statistics for a run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveUsageForRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesCreateSandbox.g.cs b/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesCreateSandbox.g.cs index 667d7796..ac515329 100644 --- a/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesCreateSandbox.g.cs +++ b/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesCreateSandbox.g.cs @@ -21,6 +21,19 @@ public partial interface ISandboxesClient /// Create Sandbox
/// Create a new Modal Sandbox that runs letta remote automatically /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SandboxesCreateSandboxAsResponseAsync( + + global::Letta.SandboxesCreateSandboxRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Sandbox
+ /// Create a new Modal Sandbox that runs letta remote automatically + ///
/// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesListSandboxes.g.cs b/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesListSandboxes.g.cs index b336b832..c6a67b4b 100644 --- a/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesListSandboxes.g.cs +++ b/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesListSandboxes.g.cs @@ -18,5 +18,19 @@ public partial interface ISandboxesClient string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Sandboxes
+ /// List all sandboxes for the organization + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SandboxesListSandboxesAsResponseAsync( + string? agentId = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesTerminateSandbox.g.cs b/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesTerminateSandbox.g.cs index 37ca1ce3..686671d6 100644 --- a/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesTerminateSandbox.g.cs +++ b/src/libs/Letta/Generated/Letta.ISandboxesClient.SandboxesTerminateSandbox.g.cs @@ -24,6 +24,21 @@ public partial interface ISandboxesClient /// Terminate a Modal Sandbox /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SandboxesTerminateSandboxAsResponseAsync( + string sandboxId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Terminate Sandbox
+ /// Terminate a Modal Sandbox + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs index 0e47c5d1..d85acc2f 100644 --- a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs @@ -27,6 +27,23 @@ public partial interface IScheduledMessagesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ScheduledMessagesDeleteScheduledMessageAsResponseAsync( + string agentId, + string scheduledMessageId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Scheduled Agent Message
+ /// Delete a scheduled message by its ID for a specific agent. + ///
+ /// + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs index 2c71247b..01046d4a 100644 --- a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs @@ -20,5 +20,21 @@ public partial interface IScheduledMessagesClient string? after = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Scheduled Agent Messages
+ /// List all scheduled messages for a specific agent. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ScheduledMessagesListScheduledMessagesAsResponseAsync( + string agentId, + string? limit = default, + string? after = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs index c1cd2ba6..a3968a63 100644 --- a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs @@ -18,5 +18,19 @@ public partial interface IScheduledMessagesClient string scheduledMessageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Scheduled Agent Message
+ /// Retrieve a scheduled message by its ID for a specific agent. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ScheduledMessagesRetrieveScheduledMessageAsResponseAsync( + string agentId, + string scheduledMessageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs index 45f0c427..56d944fb 100644 --- a/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.IScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs @@ -24,6 +24,21 @@ public partial interface IScheduledMessagesClient /// Schedule a message to be sent by the agent at a specified time or on a recurring basis. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ScheduledMessagesScheduleAgentMessageAsResponseAsync( + string agentId, + + global::Letta.ScheduledMessagesScheduleAgentMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Schedule Agent Message
+ /// Schedule a message to be sent by the agent at a specified time or on a recurring basis. + ///
+ /// /// /// /// diff --git a/src/libs/Letta/Generated/Letta.IStepsClient.ListMessagesForStep.g.cs b/src/libs/Letta/Generated/Letta.IStepsClient.ListMessagesForStep.g.cs index d38a750d..69e4a4b4 100644 --- a/src/libs/Letta/Generated/Letta.IStepsClient.ListMessagesForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.IStepsClient.ListMessagesForStep.g.cs @@ -41,5 +41,42 @@ public partial interface IStepsClient string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Messages For Step
+ /// List messages for a given step. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Sort by field
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListMessagesForStepAsResponseAsync( + string stepId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesForStepOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IStepsClient.ListSteps.g.cs b/src/libs/Letta/Generated/Letta.IStepsClient.ListSteps.g.cs index 641eced3..39e76112 100644 --- a/src/libs/Letta/Generated/Letta.IStepsClient.ListSteps.g.cs +++ b/src/libs/Letta/Generated/Letta.IStepsClient.ListSteps.g.cs @@ -77,5 +77,78 @@ public partial interface IStepsClient string? xProject = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Steps
+ /// List steps with optional pagination and date filters. + ///
+ /// + /// Return steps before this step ID + /// + /// + /// Return steps after this step ID + /// + /// + /// Maximum number of steps to return
+ /// Default Value: 50 + /// + /// + /// Sort order for steps by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Return steps after this ISO datetime (e.g. "2025-01-29T15:01:19-08:00") + /// + /// + /// Return steps before this ISO datetime (e.g. "2025-01-29T15:01:19-08:00") + /// + /// + /// Filter by the name of the model used for the step + /// + /// + /// Filter by the ID of the agent that performed the step + /// + /// + /// Filter by trace ids returned by the server + /// + /// + /// Filter by feedback + /// + /// + /// Filter by whether steps have feedback (true) or not (false) + /// + /// + /// Filter by tags + /// + /// + /// Filter by the project ID that is associated with the step (cloud only). + /// + /// + /// Filter by project slug to associate with the group (cloud only). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListStepsAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListStepsOrder? order = default, + string? orderBy = default, + string? startDate = default, + string? endDate = default, + string? model = default, + string? agentId = default, + global::System.Collections.Generic.IList? traceIds = default, + global::Letta.ListStepsFeedback2? feedback = default, + bool? hasFeedback = default, + global::System.Collections.Generic.IList? tags = default, + string? projectId = default, + string? xProject = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IStepsClient.ModifyFeedbackForStep.g.cs b/src/libs/Letta/Generated/Letta.IStepsClient.ModifyFeedbackForStep.g.cs index 344eacf4..001daec3 100644 --- a/src/libs/Letta/Generated/Letta.IStepsClient.ModifyFeedbackForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.IStepsClient.ModifyFeedbackForStep.g.cs @@ -28,6 +28,23 @@ public partial interface IStepsClient /// /// The ID of the step in the format 'step-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyFeedbackForStepAsResponseAsync( + string stepId, + + global::Letta.ModifyFeedbackRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Feedback For Step
+ /// Modify feedback for a given step. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// /// /// Whether this feedback is positive or negative /// diff --git a/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveMetricsForStep.g.cs b/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveMetricsForStep.g.cs index 422f027b..80007c4d 100644 --- a/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveMetricsForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveMetricsForStep.g.cs @@ -18,5 +18,19 @@ public partial interface IStepsClient string stepId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Metrics For Step
+ /// Get step metrics by step ID. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveMetricsForStepAsResponseAsync( + string stepId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveStep.g.cs b/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveStep.g.cs index c9c884b1..2d2e5c05 100644 --- a/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveStep.g.cs +++ b/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveStep.g.cs @@ -18,5 +18,19 @@ public partial interface IStepsClient string stepId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Step
+ /// Get a step by ID. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveStepAsResponseAsync( + string stepId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveTraceForStep.g.cs b/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveTraceForStep.g.cs index 8de1ef97..75d95176 100644 --- a/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveTraceForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.IStepsClient.RetrieveTraceForStep.g.cs @@ -17,5 +17,18 @@ public partial interface IStepsClient string stepId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Trace For Step + /// + /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveTraceForStepAsResponseAsync( + string stepId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ITagClient.ListTags.g.cs b/src/libs/Letta/Generated/Letta.ITagClient.ListTags.g.cs index 62320bf3..b6648de0 100644 --- a/src/libs/Letta/Generated/Letta.ITagClient.ListTags.g.cs +++ b/src/libs/Letta/Generated/Letta.ITagClient.ListTags.g.cs @@ -47,5 +47,46 @@ public partial interface ITagClient string? name = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Tags
+ /// Get the list of all tags (from agents and blocks) that have been created. + ///
+ /// + /// Tag cursor for pagination. Returns tags that come before this tag in the specified sort order + /// + /// + /// Tag cursor for pagination. Returns tags that come after this tag in the specified sort order + /// + /// + /// Maximum number of tags to return
+ /// Default Value: 50 + /// + /// + /// Sort order for tags. 'asc' for alphabetical order, 'desc' for reverse alphabetical order
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: name + /// + /// + /// Filter tags by text search. Deprecated, please use name field instead + /// + /// + /// Filter tags by name + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListTagsAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListTagsOrder? order = default, + string? orderBy = default, + string? queryText = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs index 3d45fa65..6be86c41 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TemplatesCreateAgentsFromTemplateAsResponseAsync( + string projectId, + string templateVersion, + + global::Letta.TemplatesCreateAgentsFromTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agents From Template
+ /// Creates an Agent or multiple Agents from a template + ///
+ /// + /// /// /// The tags to assign to the agent /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs index 77611d31..8e676a1b 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Creates an Agent or multiple Agents from a template /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesCreateAgentsFromTemplateNoProjectAsResponseAsync( + string templateVersion, + + global::Letta.TemplatesCreateAgentsFromTemplateNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Agents From Template
+ /// Creates an Agent or multiple Agents from a template + ///
+ /// /// /// The tags to assign to the agent /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplate.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplate.g.cs index 85c6c157..b59d9f49 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplate.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Creates a new template from an existing agent or agent file /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesCreateTemplateAsResponseAsync( + string projectId, + + global::Letta.TemplatesCreateTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create template (Cloud-only)
+ /// Creates a new template from an existing agent or agent file + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplateNoProject.g.cs index 575c5e23..d0b508da 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesCreateTemplateNoProject.g.cs @@ -21,6 +21,19 @@ public partial interface ITemplatesClient /// Create template (Cloud-only)
/// Creates a new template from an existing agent or agent file /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesCreateTemplateNoProjectAsResponseAsync( + + global::Letta.TemplatesCreateTemplateNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create template (Cloud-only)
+ /// Creates a new template from an existing agent or agent file + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplate.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplate.g.cs index 88182d3f..842c96af 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplate.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesDeleteTemplateAsResponseAsync( + string projectId, + string templateName, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete template (Cloud-only)
+ /// Deletes all versions of a template with the specified name + ///
+ /// + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplateNoProject.g.cs index 673a8838..a11cf94a 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesDeleteTemplateNoProject.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Deletes all versions of a template with the specified name /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesDeleteTemplateNoProjectAsResponseAsync( + string templateName, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete template (Cloud-only)
+ /// Deletes all versions of a template with the specified name + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesForkTemplate.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesForkTemplate.g.cs index 0d68d7d3..5392ffaf 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesForkTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesForkTemplate.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesForkTemplateAsResponseAsync( + string projectId, + string templateVersion, + + global::Letta.TemplatesForkTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fork template (Cloud-only)
+ /// Forks a template version into a new template + ///
+ /// + /// /// /// Optional custom name for the forked template. If not provided, a random name will be generated. /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesGetTemplateSnapshot.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesGetTemplateSnapshot.g.cs index 6fac903b..8a6b367f 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesGetTemplateSnapshot.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesGetTemplateSnapshot.g.cs @@ -18,5 +18,19 @@ public partial interface ITemplatesClient string templateVersion, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get template snapshot (Cloud-only)
+ /// Get a snapshot of the template version, this will return the template state at a specific version + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesGetTemplateSnapshotAsResponseAsync( + string projectId, + string templateVersion, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesLegacyMigration.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesLegacyMigration.g.cs index 0feb2322..d4692f58 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesLegacyMigration.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesLegacyMigration.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Migrates a template from a legacy project to the default project. Only works if the template is currently in a legacy project. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesLegacyMigrationAsResponseAsync( + string templateId, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Migrate template from legacy project (Cloud-only)
+ /// Migrates a template from a legacy project to the default project. Only works if the template is currently in a legacy project. + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplateVersions.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplateVersions.g.cs index 268c0ce7..9c0aec61 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplateVersions.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplateVersions.g.cs @@ -22,5 +22,23 @@ public partial interface ITemplatesClient string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List template versions (Cloud-only)
+ /// List all versions of a specific template + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesListTemplateVersionsAsResponseAsync( + string projectId, + string name, + global::Letta.OneOf? offset = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplates.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplates.g.cs index 0a6c5841..d1aedbd2 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplates.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesListTemplates.g.cs @@ -34,5 +34,35 @@ public partial interface ITemplatesClient global::Letta.TemplatesListTemplatesSortBy? sortBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List templates (Cloud-only)
+ /// List all templates + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesListTemplatesAsResponseAsync( + global::Letta.OneOf? offset = default, + string? exact = default, + string? limit = default, + string? version = default, + string? templateId = default, + string? name = default, + string? search = default, + string? projectSlug = default, + string? projectId = default, + global::Letta.TemplatesListTemplatesSortBy? sortBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesMigrateDeployment.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesMigrateDeployment.g.cs index 58f41ebc..00ef0505 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesMigrateDeployment.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesMigrateDeployment.g.cs @@ -30,6 +30,25 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesMigrateDeploymentAsResponseAsync( + string projectId, + string templateName, + string deploymentId, + + global::Letta.TemplatesMigrateDeploymentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Migrate deployment to template version (Cloud-only)
+ /// Migrates a deployment to a specific template version + ///
+ /// + /// + /// /// /// The target template version to migrate to /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRenameTemplate.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRenameTemplate.g.cs index e23e9912..6ff6fa54 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRenameTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRenameTemplate.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesRenameTemplateAsResponseAsync( + string projectId, + string templateName, + + global::Letta.TemplatesRenameTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rename template (Cloud-only)
+ /// Renames all versions of a template with the specified name. Versions are automatically stripped from the current template name if accidentally included. + ///
+ /// + /// /// /// The new name for the template /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplate.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplate.g.cs index 55884def..1f9119d4 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplate.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesRollbackTemplateAsResponseAsync( + string projectId, + string templateName, + + global::Letta.TemplatesRollbackTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rollback template to previous version (Cloud-only)
+ /// Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. + ///
+ /// + /// /// /// The target version to rollback to (e.g., "1", "2", "latest"). Cannot be "current" or "dev". /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplateNoProject.g.cs index 0d8ec184..ff92dae3 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesRollbackTemplateNoProject.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesRollbackTemplateNoProjectAsResponseAsync( + string templateName, + + global::Letta.TemplatesRollbackTemplateNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rollback template to previous version (Cloud-only)
+ /// Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. + ///
+ /// /// /// The target version to rollback to (e.g., "1", "2", "latest"). Cannot be "current" or "dev". /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersion.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersion.g.cs index 6c8970b4..d385fecd 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersion.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersion.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesSaveTemplateVersionAsResponseAsync( + string projectId, + string templateName, + + global::Letta.TemplatesSaveTemplateVersionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Save template version (Cloud-only)
+ /// Saves the current version of the template as a new version + ///
+ /// + /// /// /// If true, the environment variables will be preserved in the template version when migrating agents /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs index 59b850e2..204283fa 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Saves the current version of the template as a new version /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesSaveTemplateVersionNoProjectAsResponseAsync( + string templateName, + + global::Letta.TemplatesSaveTemplateVersionNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Save template version (Cloud-only)
+ /// Saves the current version of the template as a new version + ///
+ /// /// /// If true, the environment variables will be preserved in the template version when migrating agents /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs index ff22b3a4..8999d435 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesSetCurrentTemplateFromSnapshotAsResponseAsync( + string projectId, + string templateVersion, + + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set current template from snapshot (Cloud-only)
+ /// Updates the current working version of a template from a snapshot + ///
+ /// + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs index 3b50f6f7..e7f7fc75 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesUpdateCurrentTemplateFromAgentFileAsResponseAsync( + string projectId, + string templateName, + + global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update current template from agent file (Cloud-only)
+ /// Updates the current working version of a template from an agent file + ///
+ /// + /// /// /// The agent file to update the current template version from /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs index 9aea6cd5..d72bd76d 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs @@ -24,6 +24,21 @@ public partial interface ITemplatesClient /// Updates the current working version of a template from an agent file /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesUpdateCurrentTemplateFromAgentFileNoProjectAsResponseAsync( + string templateName, + + global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update current template from agent file (Cloud-only)
+ /// Updates the current working version of a template from an agent file + ///
+ /// /// /// The agent file to update the current template version from /// diff --git a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateTemplateDescription.g.cs b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateTemplateDescription.g.cs index 801aeeaf..fcf0eac0 100644 --- a/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateTemplateDescription.g.cs +++ b/src/libs/Letta/Generated/Letta.ITemplatesClient.TemplatesUpdateTemplateDescription.g.cs @@ -27,6 +27,23 @@ public partial interface ITemplatesClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TemplatesUpdateTemplateDescriptionAsResponseAsync( + string projectId, + string templateName, + + global::Letta.TemplatesUpdateTemplateDescriptionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update template description (Cloud-only)
+ /// Updates the description for all versions of a template with the specified name. Versions are automatically stripped from the current template name if accidentally included. + ///
+ /// + /// /// /// The new description for the template /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.AddBaseTools.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.AddBaseTools.g.cs index 44630aa5..a47faeba 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.AddBaseTools.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.AddBaseTools.g.cs @@ -14,5 +14,15 @@ public partial interface IToolsClient global::System.Threading.Tasks.Task> AddBaseToolsAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upsert Base Tools
+ /// Upsert base tools + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> AddBaseToolsAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpServer.g.cs index 843bc650..78fac55e 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpServer.g.cs @@ -21,6 +21,19 @@ public partial interface IToolsClient /// Add Mcp Server To Config
/// Add a new MCP server to the Letta MCP server config /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>>> AddMcpServerAsResponseAsync( + + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add Mcp Server To Config
+ /// Add a new MCP server to the Letta MCP server config + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpTool.g.cs index 1ce86cb1..84402640 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.AddMcpTool.g.cs @@ -18,5 +18,19 @@ public partial interface IToolsClient string mcpToolName, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add Mcp Tool
+ /// Register a new MCP tool as a Letta server by MCP server + tool name + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AddMcpToolAsResponseAsync( + string mcpServerName, + string mcpToolName, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ConnectMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ConnectMcpServer.g.cs index ceb6ee41..81a03ed3 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ConnectMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ConnectMcpServer.g.cs @@ -23,6 +23,20 @@ public partial interface IToolsClient /// Connect to an MCP server with support for OAuth via SSE.
/// Returns a stream of events handling authorization state and exchange if OAuth is required. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ConnectMcpServerAsResponseAsync( + + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Connect Mcp Server
+ /// Connect to an MCP server with support for OAuth via SSE.
+ /// Returns a stream of events handling authorization state and exchange if OAuth is required. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.CountTools.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.CountTools.g.cs index 17bf5a94..32149dd6 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.CountTools.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.CountTools.g.cs @@ -46,5 +46,47 @@ public partial interface IToolsClient bool? excludeLettaTools = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Count Tools
+ /// Get a count of all tools available to agents belonging to the org of the user. + ///
+ /// + /// + /// Filter by specific tool names + /// + /// + /// Filter by specific tool IDs - accepts repeated params or comma-separated values + /// + /// + /// Search tool names (case-insensitive partial match) + /// + /// + /// Filter by tool type(s) - accepts repeated params or comma-separated values + /// + /// + /// Tool type(s) to exclude - accepts repeated params or comma-separated values + /// + /// + /// Count only tools with tool_type starting with 'letta_'
+ /// Default Value: false + /// + /// + /// Exclude built-in Letta tools from the count
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CountToolsAsResponseAsync( + string? name = default, + global::System.Collections.Generic.IList? names = default, + global::System.Collections.Generic.IList? toolIds = default, + string? search = default, + global::System.Collections.Generic.IList? toolTypes = default, + global::System.Collections.Generic.IList? excludeToolTypes = default, + bool? returnOnlyLettaTools = default, + bool? excludeLettaTools = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.CreateTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.CreateTool.g.cs index 5a33b285..5bc87eb2 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.CreateTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.CreateTool.g.cs @@ -21,6 +21,19 @@ public partial interface IToolsClient /// Create Tool
/// Create a new tool /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateToolAsResponseAsync( + + global::Letta.ToolCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Tool
+ /// Create a new tool + ///
/// /// The description of the tool. /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.DeleteMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.DeleteMcpServer.g.cs index 2762d31f..eacff69d 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.DeleteMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.DeleteMcpServer.g.cs @@ -16,5 +16,17 @@ public partial interface IToolsClient string mcpServerName, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Mcp Server From Config
+ /// Delete a MCP server configuration + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>>> DeleteMcpServerAsResponseAsync( + string mcpServerName, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.DeleteTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.DeleteTool.g.cs index e5863b4c..df801651 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.DeleteTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.DeleteTool.g.cs @@ -18,5 +18,19 @@ public partial interface IToolsClient string toolId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Tool
+ /// Delete a tool by name + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteToolAsResponseAsync( + string toolId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ExecuteMcpTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ExecuteMcpTool.g.cs index b73d4335..07e2b8ba 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ExecuteMcpTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ExecuteMcpTool.g.cs @@ -29,6 +29,24 @@ public partial interface IToolsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ExecuteMcpToolAsResponseAsync( + string mcpServerName, + string toolName, + + global::Letta.LettaServerRestApiRoutersV1ToolsToolExecuteRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Execute Mcp Tool
+ /// Execute a specific MCP tool from a configured server.
+ /// Returns the tool execution result. + ///
+ /// + /// /// /// Arguments to pass to the tool /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpServers.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpServers.g.cs index 634a61cd..96b55a3f 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpServers.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpServers.g.cs @@ -14,5 +14,15 @@ public partial interface IToolsClient global::System.Threading.Tasks.Task ListMcpServersAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Mcp Servers
+ /// Get a list of all configured MCP servers + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListMcpServersAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpToolsByServer.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpToolsByServer.g.cs index 76497a80..42c8439d 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpToolsByServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ListMcpToolsByServer.g.cs @@ -16,5 +16,17 @@ public partial interface IToolsClient string mcpServerName, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Mcp Tools By Server
+ /// Get a list of all tools for a specific MCP server + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListMcpToolsByServerAsResponseAsync( + string mcpServerName, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ListTools.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ListTools.g.cs index dc24240d..242dd3c8 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ListTools.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ListTools.g.cs @@ -66,5 +66,67 @@ public partial interface IToolsClient bool? returnOnlyLettaTools = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Tools
+ /// Get a list of all tools available to agents. + ///
+ /// + /// Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order + /// + /// + /// Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order + /// + /// + /// Maximum number of tools to return
+ /// Default Value: 50 + /// + /// + /// Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter by single tool name + /// + /// + /// Filter by specific tool names + /// + /// + /// Filter by specific tool IDs - accepts repeated params or comma-separated values + /// + /// + /// Search tool names (case-insensitive partial match) + /// + /// + /// Filter by tool type(s) - accepts repeated params or comma-separated values + /// + /// + /// Tool type(s) to exclude - accepts repeated params or comma-separated values + /// + /// + /// Return only tools with tool_type starting with 'letta_'
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListToolsAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListToolsOrder? order = default, + string? orderBy = default, + string? name = default, + global::System.Collections.Generic.IList? names = default, + global::System.Collections.Generic.IList? toolIds = default, + string? search = default, + global::System.Collections.Generic.IList? toolTypes = default, + global::System.Collections.Generic.IList? excludeToolTypes = default, + bool? returnOnlyLettaTools = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.McpOauthCallback.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.McpOauthCallback.g.cs index 69f31623..e42fdeee 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.McpOauthCallback.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.McpOauthCallback.g.cs @@ -31,5 +31,32 @@ public partial interface IToolsClient string? errorDescription = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Mcp Oauth Callback
+ /// Handle OAuth callback for MCP server authentication.
+ /// Session is identified via the state parameter instead of URL path. + ///
+ /// + /// OAuth authorization code + /// + /// + /// OAuth state parameter + /// + /// + /// OAuth error + /// + /// + /// OAuth error description + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> McpOauthCallbackAsResponseAsync( + string? code = default, + string? state = default, + string? error = default, + string? errorDescription = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ModifyTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ModifyTool.g.cs index c0feebed..83c9779d 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ModifyTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ModifyTool.g.cs @@ -28,6 +28,23 @@ public partial interface IToolsClient /// /// The ID of the tool in the format 'tool-<uuid4>' /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModifyToolAsResponseAsync( + string toolId, + + global::Letta.ToolUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Modify Tool
+ /// Update an existing tool + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// /// /// The description of the tool. /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.ResyncMcpServerTools.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.ResyncMcpServerTools.g.cs index 32fb41bb..0405e30b 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.ResyncMcpServerTools.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.ResyncMcpServerTools.g.cs @@ -23,5 +23,24 @@ public partial interface IToolsClient string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Resync Mcp Server Tools
+ /// Resync tools for an MCP server by:
+ /// 1. Fetching current tools from the MCP server
+ /// 2. Deleting tools that no longer exist on the server
+ /// 3. Updating schemas for existing tools
+ /// 4. Adding new tools from the server
+ /// Returns a summary of changes made. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ResyncMcpServerToolsAsResponseAsync( + string mcpServerName, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.RetrieveTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.RetrieveTool.g.cs index 7d066e8a..d4a6076e 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.RetrieveTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.RetrieveTool.g.cs @@ -18,5 +18,19 @@ public partial interface IToolsClient string toolId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Tool
+ /// Get a tool by ID + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveToolAsResponseAsync( + string toolId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.RunToolFromSource.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.RunToolFromSource.g.cs index 4499ef2d..1f70da69 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.RunToolFromSource.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.RunToolFromSource.g.cs @@ -21,6 +21,19 @@ public partial interface IToolsClient /// Run Tool From Source
/// Attempt to build a tool from source, then run it on the provided arguments /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunToolFromSourceAsResponseAsync( + + global::Letta.ToolRunFromSource request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Tool From Source
+ /// Attempt to build a tool from source, then run it on the provided arguments + ///
/// /// The source code of the function. /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.SearchTools.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.SearchTools.g.cs index 57caa860..d91340e3 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.SearchTools.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.SearchTools.g.cs @@ -27,6 +27,22 @@ public partial interface IToolsClient /// full-text search, or hybrid mode to find tools matching the query.
/// Returns tools ranked by relevance with their search scores. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> SearchToolsAsResponseAsync( + + global::Letta.ToolSearchRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Search Tools
+ /// Search tools using semantic search.
+ /// Requires tool embedding to be enabled (embed_tools=True). Uses vector search,
+ /// full-text search, or hybrid mode to find tools matching the query.
+ /// Returns tools ranked by relevance with their search scores. + ///
/// /// Text query for semantic search. /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.TestMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.TestMcpServer.g.cs index 06355c16..5edf83fa 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.TestMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.TestMcpServer.g.cs @@ -23,6 +23,20 @@ public partial interface IToolsClient /// Test connection to an MCP server without adding it.
/// Returns the list of available tools if successful. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TestMcpServerAsResponseAsync( + + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Test Mcp Server
+ /// Test connection to an MCP server without adding it.
+ /// Returns the list of available tools if successful. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.UpdateMcpServer.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.UpdateMcpServer.g.cs index d5c846b4..d85312f9 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.UpdateMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.UpdateMcpServer.g.cs @@ -24,6 +24,21 @@ public partial interface IToolsClient /// Update an existing MCP server configuration /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> UpdateMcpServerAsResponseAsync( + string mcpServerName, + + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Mcp Server
+ /// Update an existing MCP server configuration + ///
+ /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Letta/Generated/Letta.IToolsClient.UpsertTool.g.cs b/src/libs/Letta/Generated/Letta.IToolsClient.UpsertTool.g.cs index 17322a32..12881c85 100644 --- a/src/libs/Letta/Generated/Letta.IToolsClient.UpsertTool.g.cs +++ b/src/libs/Letta/Generated/Letta.IToolsClient.UpsertTool.g.cs @@ -21,6 +21,19 @@ public partial interface IToolsClient /// Upsert Tool
/// Create or update a tool /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpsertToolAsResponseAsync( + + global::Letta.ToolCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upsert Tool
+ /// Create or update a tool + ///
/// /// The description of the tool. /// diff --git a/src/libs/Letta/Generated/Letta.InternalAgentsClient.CountInternalAgents.g.cs b/src/libs/Letta/Generated/Letta.InternalAgentsClient.CountInternalAgents.g.cs index 266cc09d..be1e6060 100644 --- a/src/libs/Letta/Generated/Letta.InternalAgentsClient.CountInternalAgents.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalAgentsClient.CountInternalAgents.g.cs @@ -69,6 +69,30 @@ partial void ProcessCountInternalAgentsResponseContent( bool? excludeHidden = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CountInternalAgentsAsResponseAsync( + excludeHidden: excludeHidden, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Agents
+ /// Get the total number of agents for a user, with option to exclude hidden agents. + ///
+ /// + /// If True, excludes hidden agents from the count. If False, includes all agents.
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CountInternalAgentsAsResponseAsync( + bool? excludeHidden = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -98,13 +122,14 @@ partial void ProcessCountInternalAgentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_agents/count", baseUri: ResolveBaseUri( servers: s_CountInternalAgentsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("exclude_hidden", excludeHidden?.ToString().ToLowerInvariant()) + .AddOptionalParameter("exclude_hidden", excludeHidden?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -176,6 +201,8 @@ partial void ProcessCountInternalAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessCountInternalAgentsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessCountInternalAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessCountInternalAgentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessCountInternalAgentsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessCountInternalAgentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessCountInternalAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessCountInternalAgentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -367,9 +410,13 @@ partial void ProcessCountInternalAgentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? + var __value = (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,9 +444,13 @@ partial void ProcessCountInternalAgentsResponseContent( #endif ).ConfigureAwait(false); - return - (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs b/src/libs/Letta/Generated/Letta.InternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs index ef144860..31913c81 100644 --- a/src/libs/Letta/Generated/Letta.InternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalAgentsClient.ModifyInternalCoreMemoryBlock.g.cs @@ -74,6 +74,37 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( string blockLabel, string agentId, + global::Letta.BlockUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyInternalCoreMemoryBlockAsResponseAsync( + blockLabel: blockLabel, + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Block For Agent
+ /// Updates a core memory block of an agent. + ///
+ /// + /// + /// The ID of the agent in the format 'agent-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyInternalCoreMemoryBlockAsResponseAsync( + string blockLabel, + string agentId, + global::Letta.BlockUpdate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -110,6 +141,7 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/_internal_agents/{agentId}/core-memory/blocks/{blockLabel}", baseUri: ResolveBaseUri( @@ -193,6 +225,8 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +237,11 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +259,8 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +270,7 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +279,11 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +300,15 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +348,8 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +370,8 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -384,9 +434,13 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Block.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Block.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -414,9 +468,13 @@ partial void ProcessModifyInternalCoreMemoryBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Block.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Block.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalAgentsClient.g.cs b/src/libs/Letta/Generated/Letta.InternalAgentsClient.g.cs index 56bc188b..3631bed1 100644 --- a/src/libs/Letta/Generated/Letta.InternalAgentsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalAgentsClient.g.cs @@ -103,10 +103,10 @@ public InternalAgentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public InternalAgentsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.InternalBlocksClient.CreateInternalBlock.g.cs b/src/libs/Letta/Generated/Letta.InternalBlocksClient.CreateInternalBlock.g.cs index 35eb1a16..5de643fc 100644 --- a/src/libs/Letta/Generated/Letta.InternalBlocksClient.CreateInternalBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalBlocksClient.CreateInternalBlock.g.cs @@ -63,6 +63,28 @@ partial void ProcessCreateInternalBlockResponseContent( /// public async global::System.Threading.Tasks.Task CreateInternalBlockAsync( + global::Letta.CreateBlock request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateInternalBlockAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Block + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateInternalBlockAsResponseAsync( + global::Letta.CreateBlock request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,6 +119,7 @@ partial void ProcessCreateInternalBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_blocks/", baseUri: ResolveBaseUri( @@ -178,6 +201,8 @@ partial void ProcessCreateInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +213,11 @@ partial void ProcessCreateInternalBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +235,8 @@ partial void ProcessCreateInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +246,7 @@ partial void ProcessCreateInternalBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +255,11 @@ partial void ProcessCreateInternalBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +276,15 @@ partial void ProcessCreateInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +324,8 @@ partial void ProcessCreateInternalBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +346,8 @@ partial void ProcessCreateInternalBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +410,13 @@ partial void ProcessCreateInternalBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Block.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Block.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -399,9 +444,13 @@ partial void ProcessCreateInternalBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Block.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Block.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalBlocksClient.DeleteInternalBlock.g.cs b/src/libs/Letta/Generated/Letta.InternalBlocksClient.DeleteInternalBlock.g.cs index 7433528a..da45480e 100644 --- a/src/libs/Letta/Generated/Letta.InternalBlocksClient.DeleteInternalBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalBlocksClient.DeleteInternalBlock.g.cs @@ -67,6 +67,28 @@ partial void ProcessDeleteInternalBlockResponseContent( string blockId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteInternalBlockAsResponseAsync( + blockId: blockId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Block + /// + /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteInternalBlockAsResponseAsync( + string blockId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +118,7 @@ partial void ProcessDeleteInternalBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/_internal_blocks/{blockId}", baseUri: ResolveBaseUri( @@ -171,6 +194,8 @@ partial void ProcessDeleteInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +206,11 @@ partial void ProcessDeleteInternalBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -198,6 +228,8 @@ partial void ProcessDeleteInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +239,7 @@ partial void ProcessDeleteInternalBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +248,11 @@ partial void ProcessDeleteInternalBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -233,14 +269,15 @@ partial void ProcessDeleteInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +317,8 @@ partial void ProcessDeleteInternalBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +339,8 @@ partial void ProcessDeleteInternalBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,7 +403,11 @@ partial void ProcessDeleteInternalBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -390,7 +435,11 @@ partial void ProcessDeleteInternalBlockResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListAgentsForInternalBlock.g.cs b/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListAgentsForInternalBlock.g.cs index 244f2055..369369b8 100644 --- a/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListAgentsForInternalBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListAgentsForInternalBlock.g.cs @@ -117,6 +117,69 @@ partial void ProcessListAgentsForInternalBlockResponseContent( global::System.Collections.Generic.IList? include = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAgentsForInternalBlockAsResponseAsync( + blockId: blockId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + includeRelationships: includeRelationships, + include: include, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents For Block
+ /// Retrieves all agents associated with the specified block.
+ /// Raises a 404 if the block does not exist. + ///
+ /// + /// The ID of the block in the format 'block-<uuid4>' + /// + /// + /// Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order + /// + /// + /// Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order + /// + /// + /// Maximum number of agents to return
+ /// Default Value: 50 + /// + /// + /// Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. + /// + /// + /// Specify which relational fields to include in the response. No relationships are included by default.
+ /// Default Value: [] + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAgentsForInternalBlockAsResponseAsync( + string blockId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAgentsForInternalBlockOrder? order = default, + string? orderBy = default, + global::System.Collections.Generic.IList? includeRelationships = default, + global::System.Collections.Generic.IList? include = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -153,11 +216,12 @@ partial void ProcessListAgentsForInternalBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/_internal_blocks/{blockId}/agents", baseUri: ResolveBaseUri( servers: s_ListAgentsForInternalBlockServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -165,7 +229,7 @@ partial void ProcessListAgentsForInternalBlockResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("include_relationships", includeRelationships?.ToString()) - .AddOptionalParameter("include", include, delimiter: ",", explode: true) + .AddOptionalParameter("include", include, delimiter: ",", explode: true) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -244,6 +308,8 @@ partial void ProcessListAgentsForInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -254,6 +320,11 @@ partial void ProcessListAgentsForInternalBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -271,6 +342,8 @@ partial void ProcessListAgentsForInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -280,8 +353,7 @@ partial void ProcessListAgentsForInternalBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +362,11 @@ partial void ProcessListAgentsForInternalBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -306,14 +383,15 @@ partial void ProcessListAgentsForInternalBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -353,6 +431,8 @@ partial void ProcessListAgentsForInternalBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -373,6 +453,8 @@ partial void ProcessListAgentsForInternalBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -435,9 +517,13 @@ partial void ProcessListAgentsForInternalBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -465,9 +551,13 @@ partial void ProcessListAgentsForInternalBlockResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListInternalBlocks.g.cs b/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListInternalBlocks.g.cs index 7b632570..8046494a 100644 --- a/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListInternalBlocks.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalBlocksClient.ListInternalBlocks.g.cs @@ -167,6 +167,112 @@ partial void ProcessListInternalBlocksResponseContent( global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListInternalBlocksAsResponseAsync( + label: label, + templatesOnly: templatesOnly, + name: name, + identityId: identityId, + identifierKeys: identifierKeys, + projectId: projectId, + limit: limit, + before: before, + after: after, + order: order, + orderBy: orderBy, + labelSearch: labelSearch, + descriptionSearch: descriptionSearch, + valueSearch: valueSearch, + connectedToAgentsCountGt: connectedToAgentsCountGt, + connectedToAgentsCountLt: connectedToAgentsCountLt, + connectedToAgentsCountEq: connectedToAgentsCountEq, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Blocks + /// + /// + /// Label to include (alphanumeric, hyphens, underscores, forward slashes) + /// + /// + /// Whether to include only templates
+ /// Default Value: false + /// + /// + /// Name filter (alphanumeric, spaces, hyphens, underscores) + /// + /// + /// The ID of the identity in the format 'identity-<uuid4>' + /// + /// + /// Search agents by identifier keys + /// + /// + /// Search blocks by project id + /// + /// + /// Number of blocks to return
+ /// Default Value: 50 + /// + /// + /// Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order + /// + /// + /// Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order + /// + /// + /// Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Search blocks by label. If provided, returns blocks whose label matches the search query. This is a full-text search on block labels. + /// + /// + /// Search blocks by description. If provided, returns blocks whose description matches the search query. This is a full-text search on block descriptions. + /// + /// + /// Search blocks by value. If provided, returns blocks whose value matches the search query. This is a full-text search on block values. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have more than this number of connected agents. + /// + /// + /// Filter blocks by the number of connected agents. If provided, returns blocks that have less than this number of connected agents. + /// + /// + /// Filter blocks by the exact number of connected agents. If provided, returns blocks that have exactly this number of connected agents. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListInternalBlocksAsResponseAsync( + string? label = default, + bool? templatesOnly = default, + string? name = default, + string? identityId = default, + global::System.Collections.Generic.IList? identifierKeys = default, + string? projectId = default, + int? limit = default, + string? before = default, + string? after = default, + global::Letta.ListInternalBlocksOrder? order = default, + string? orderBy = default, + string? labelSearch = default, + string? descriptionSearch = default, + string? valueSearch = default, + int? connectedToAgentsCountGt = default, + int? connectedToAgentsCountLt = default, + global::System.Collections.Generic.IList? connectedToAgentsCountEq = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -212,11 +318,12 @@ partial void ProcessListInternalBlocksResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_blocks/", baseUri: ResolveBaseUri( servers: s_ListInternalBlocksServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("label", label) .AddOptionalParameter("templates_only", templatesOnly?.ToString().ToLowerInvariant()) @@ -234,7 +341,7 @@ partial void ProcessListInternalBlocksResponseContent( .AddOptionalParameter("value_search", valueSearch) .AddOptionalParameter("connected_to_agents_count_gt", connectedToAgentsCountGt?.ToString()) .AddOptionalParameter("connected_to_agents_count_lt", connectedToAgentsCountLt?.ToString()) - .AddOptionalParameter("connected_to_agents_count_eq", connectedToAgentsCountEq?.ToString()) + .AddOptionalParameter("connected_to_agents_count_eq", connectedToAgentsCountEq?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -322,6 +429,8 @@ partial void ProcessListInternalBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -332,6 +441,11 @@ partial void ProcessListInternalBlocksResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -349,6 +463,8 @@ partial void ProcessListInternalBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -358,8 +474,7 @@ partial void ProcessListInternalBlocksResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -368,6 +483,11 @@ partial void ProcessListInternalBlocksResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -384,14 +504,15 @@ partial void ProcessListInternalBlocksResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -431,6 +552,8 @@ partial void ProcessListInternalBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -451,6 +574,8 @@ partial void ProcessListInternalBlocksResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -513,9 +638,13 @@ partial void ProcessListInternalBlocksResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -543,9 +672,13 @@ partial void ProcessListInternalBlocksResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalBlocksClient.g.cs b/src/libs/Letta/Generated/Letta.InternalBlocksClient.g.cs index a0a3a519..5cff31f9 100644 --- a/src/libs/Letta/Generated/Letta.InternalBlocksClient.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalBlocksClient.g.cs @@ -103,10 +103,10 @@ public InternalBlocksClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public InternalBlocksClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.InternalRunsClient.ListInternalRuns.g.cs b/src/libs/Letta/Generated/Letta.InternalRunsClient.ListInternalRuns.g.cs index 17a0a9ab..27ec1161 100644 --- a/src/libs/Letta/Generated/Letta.InternalRunsClient.ListInternalRuns.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalRunsClient.ListInternalRuns.g.cs @@ -214,6 +214,150 @@ partial void ProcessListInternalRunsResponseContent( global::System.DateTime? endDate = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListInternalRunsAsResponseAsync( + runId: runId, + agentId: agentId, + agentIds: agentIds, + statuses: statuses, + background: background, + stopReason: stopReason, + templateFamily: templateFamily, + stepCount: stepCount, + stepCountOperator: stepCountOperator, + toolsUsed: toolsUsed, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + active: active, + ascending: ascending, + projectId: projectId, + conversationId: conversationId, + durationPercentile: durationPercentile, + durationValue: durationValue, + durationOperator: durationOperator, + startDate: startDate, + endDate: endDate, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Runs
+ /// List all runs. + ///
+ /// + /// Filter by a specific run ID. + /// + /// + /// The unique identifier of the agent associated with the run. + /// + /// + /// The unique identifiers of the agents associated with the run. Deprecated in favor of agent_id field. + /// + /// + /// Filter runs by status. Can specify multiple statuses. + /// + /// + /// If True, filters for runs that were created in background mode. + /// + /// + /// Filter runs by stop reason. + /// + /// + /// Filter runs by template family (base_template_id). + /// + /// + /// Filter runs by step count. Must be provided with step_count_operator. + /// + /// + /// Operator for step_count filter: 'eq' for equals, 'gte' for greater than or equal, 'lte' for less than or equal.
+ /// Default Value: eq + /// + /// + /// Filter runs that used any of the specified tools. + /// + /// + /// Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order + /// + /// + /// Run ID cursor for pagination. Returns runs that come after this run ID in the specified sort order + /// + /// + /// Maximum number of runs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter for active runs.
+ /// Default Value: false + /// + /// + /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field.
+ /// Default Value: false + /// + /// + /// Filter runs by project ID. + /// + /// + /// Filter runs by conversation ID. + /// + /// + /// Filter runs by duration percentile (1-100). Returns runs slower than this percentile. + /// + /// + /// Duration value in nanoseconds for filtering. Must be used with duration_operator. + /// + /// + /// Comparison operator for duration filter: 'gt' (greater than), 'lt' (less than), 'eq' (equals). + /// + /// + /// Filter runs created on or after this date (ISO 8601 format). + /// + /// + /// Filter runs created on or before this date (ISO 8601 format). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListInternalRunsAsResponseAsync( + string? runId = default, + string? agentId = default, + global::System.Collections.Generic.IList? agentIds = default, + global::System.Collections.Generic.IList? statuses = default, + bool? background = default, + global::Letta.StopReasonType? stopReason = default, + string? templateFamily = default, + int? stepCount = default, + global::Letta.ComparisonOperator? stepCountOperator = default, + global::System.Collections.Generic.IList? toolsUsed = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListInternalRunsOrder? order = default, + global::Letta.ListInternalRunsOrderBy? orderBy = default, + bool? active = default, + bool? ascending = default, + string? projectId = default, + string? conversationId = default, + int? durationPercentile = default, + int? durationValue = default, + global::Letta.ListInternalRunsDurationOperator2? durationOperator = default, + global::System.DateTime? startDate = default, + global::System.DateTime? endDate = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -266,11 +410,12 @@ partial void ProcessListInternalRunsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_runs/", baseUri: ResolveBaseUri( servers: s_ListInternalRunsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("run_id", runId) .AddOptionalParameter("agent_id", agentId) @@ -295,7 +440,7 @@ partial void ProcessListInternalRunsResponseContent( .AddOptionalParameter("duration_value", durationValue?.ToString()) .AddOptionalParameter("duration_operator", durationOperator?.ToString()) .AddOptionalParameter("start_date", startDate?.ToString()) - .AddOptionalParameter("end_date", endDate?.ToString()) + .AddOptionalParameter("end_date", endDate?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -390,6 +535,8 @@ partial void ProcessListInternalRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -400,6 +547,11 @@ partial void ProcessListInternalRunsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -417,6 +569,8 @@ partial void ProcessListInternalRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -426,8 +580,7 @@ partial void ProcessListInternalRunsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -436,6 +589,11 @@ partial void ProcessListInternalRunsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -452,14 +610,15 @@ partial void ProcessListInternalRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -499,6 +658,8 @@ partial void ProcessListInternalRunsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -519,6 +680,8 @@ partial void ProcessListInternalRunsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -581,9 +744,13 @@ partial void ProcessListInternalRunsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -611,9 +778,13 @@ partial void ProcessListInternalRunsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalRunsClient.g.cs b/src/libs/Letta/Generated/Letta.InternalRunsClient.g.cs index 79b96ae9..43e795e6 100644 --- a/src/libs/Letta/Generated/Letta.InternalRunsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalRunsClient.g.cs @@ -103,10 +103,10 @@ public InternalRunsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public InternalRunsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateAgent.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateAgent.g.cs index 469f2c4f..00ac0280 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateAgent.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateAgent.g.cs @@ -66,6 +66,29 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( /// public async global::System.Threading.Tasks.Task CreateInternalTemplateAgentAsync( + global::Letta.InternalTemplateAgentCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateInternalTemplateAgentAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Agent
+ /// Create a new agent with template-related fields. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateInternalTemplateAgentAsResponseAsync( + global::Letta.InternalTemplateAgentCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -100,6 +123,7 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_templates/agents", baseUri: ResolveBaseUri( @@ -181,6 +205,8 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +217,11 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +239,8 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +250,7 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +259,11 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +280,15 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +328,8 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +350,8 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -372,9 +414,13 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AgentState.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -402,9 +448,13 @@ partial void ProcessCreateInternalTemplateAgentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AgentState.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlock.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlock.g.cs index 02760d79..01eaa72a 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlock.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlock.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( /// public async global::System.Threading.Tasks.Task CreateInternalTemplateBlockAsync( + global::Letta.InternalTemplateBlockCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateInternalTemplateBlockAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Block
+ /// Create a new block with template-related fields. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateInternalTemplateBlockAsResponseAsync( + global::Letta.InternalTemplateBlockCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_templates/blocks", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Block.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Block.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateInternalTemplateBlockResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Block.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Block.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs index 7abc579b..4246f3f3 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateBlocksBatch.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( /// public async global::System.Threading.Tasks.Task> CreateInternalTemplateBlocksBatchAsync( + global::System.Collections.Generic.IList request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateInternalTemplateBlocksBatchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Blocks Batch
+ /// Create multiple blocks with template-related fields. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> CreateInternalTemplateBlocksBatchAsResponseAsync( + global::System.Collections.Generic.IList request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_templates/blocks/batch", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateInternalTemplateBlocksBatchResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateGroup.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateGroup.g.cs index d75e64ad..a0f01572 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateGroup.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.CreateInternalTemplateGroup.g.cs @@ -66,6 +66,29 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( /// public async global::System.Threading.Tasks.Task CreateInternalTemplateGroupAsync( + global::Letta.InternalTemplateGroupCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateInternalTemplateGroupAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Group
+ /// Create a new multi-agent group with the specified configuration. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateInternalTemplateGroupAsResponseAsync( + global::Letta.InternalTemplateGroupCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -100,6 +123,7 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/_internal_templates/groups", baseUri: ResolveBaseUri( @@ -181,6 +205,8 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +217,11 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +239,8 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +250,7 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +259,11 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +280,15 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +328,8 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +350,8 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -372,9 +414,13 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Group.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Group.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -402,9 +448,13 @@ partial void ProcessCreateInternalTemplateGroupResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Group.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.DeleteDeployment.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.DeleteDeployment.g.cs index 697b4d52..8b436401 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.DeleteDeployment.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.DeleteDeployment.g.cs @@ -67,6 +67,28 @@ partial void ProcessDeleteDeploymentResponseContent( string deploymentId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteDeploymentAsResponseAsync( + deploymentId: deploymentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Deployment
+ /// Delete all entities (blocks, agents, groups) with the specified deployment_id.
+ /// Deletion order: blocks -> agents -> groups to maintain referential integrity. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteDeploymentAsResponseAsync( + string deploymentId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +118,7 @@ partial void ProcessDeleteDeploymentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/_internal_templates/deployment/{deploymentId}", baseUri: ResolveBaseUri( @@ -171,6 +194,8 @@ partial void ProcessDeleteDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +206,11 @@ partial void ProcessDeleteDeploymentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -198,6 +228,8 @@ partial void ProcessDeleteDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +239,7 @@ partial void ProcessDeleteDeploymentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +248,11 @@ partial void ProcessDeleteDeploymentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -233,14 +269,15 @@ partial void ProcessDeleteDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +317,8 @@ partial void ProcessDeleteDeploymentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +339,8 @@ partial void ProcessDeleteDeploymentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,9 +403,13 @@ partial void ProcessDeleteDeploymentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.DeleteDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.DeleteDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -392,9 +437,13 @@ partial void ProcessDeleteDeploymentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.DeleteDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.DeleteDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.ListDeploymentEntities.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.ListDeploymentEntities.g.cs index 61516037..7180031e 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.ListDeploymentEntities.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.ListDeploymentEntities.g.cs @@ -73,6 +73,33 @@ partial void ProcessListDeploymentEntitiesResponseContent( global::System.Collections.Generic.IList? entityTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDeploymentEntitiesAsResponseAsync( + deploymentId: deploymentId, + entityTypes: entityTypes, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Deployment Entities
+ /// List all entities (blocks, agents, groups) with the specified deployment_id.
+ /// Optionally filter by entity types. + ///
+ /// + /// + /// Filter by entity types (block, agent, group) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListDeploymentEntitiesAsResponseAsync( + string deploymentId, + global::System.Collections.Generic.IList? entityTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -103,13 +130,14 @@ partial void ProcessListDeploymentEntitiesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/_internal_templates/deployment/{deploymentId}", baseUri: ResolveBaseUri( servers: s_ListDeploymentEntitiesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("entity_types", entityTypes?.ToString()) + .AddOptionalParameter("entity_types", entityTypes?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -182,6 +210,8 @@ partial void ProcessListDeploymentEntitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +222,11 @@ partial void ProcessListDeploymentEntitiesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +244,8 @@ partial void ProcessListDeploymentEntitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +255,7 @@ partial void ProcessListDeploymentEntitiesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +264,11 @@ partial void ProcessListDeploymentEntitiesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +285,15 @@ partial void ProcessListDeploymentEntitiesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +333,8 @@ partial void ProcessListDeploymentEntitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +355,8 @@ partial void ProcessListDeploymentEntitiesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -373,9 +419,13 @@ partial void ProcessListDeploymentEntitiesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ListDeploymentEntitiesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ListDeploymentEntitiesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -403,9 +453,13 @@ partial void ProcessListDeploymentEntitiesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ListDeploymentEntitiesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ListDeploymentEntitiesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.g.cs b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.g.cs index 9c4f3f1a..cfd0f52f 100644 --- a/src/libs/Letta/Generated/Letta.InternalTemplatesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.InternalTemplatesClient.g.cs @@ -103,10 +103,10 @@ public InternalTemplatesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public InternalTemplatesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.JobsClient.CancelJob.g.cs b/src/libs/Letta/Generated/Letta.JobsClient.CancelJob.g.cs index d33a256c..ba5e025b 100644 --- a/src/libs/Letta/Generated/Letta.JobsClient.CancelJob.g.cs +++ b/src/libs/Letta/Generated/Letta.JobsClient.CancelJob.g.cs @@ -70,6 +70,31 @@ partial void ProcessCancelJobResponseContent( string jobId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel Job
+ /// Cancel a job by its job_id.
+ /// This endpoint marks a job as cancelled, which will cause any associated
+ /// agent execution to terminate as soon as possible. + ///
+ /// + /// The ID of the job in the format 'job-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CancelJobAsResponseAsync( + string jobId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -99,6 +124,7 @@ partial void ProcessCancelJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/jobs/{jobId}/cancel", baseUri: ResolveBaseUri( @@ -174,6 +200,8 @@ partial void ProcessCancelJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +212,11 @@ partial void ProcessCancelJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -201,6 +234,8 @@ partial void ProcessCancelJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +245,7 @@ partial void ProcessCancelJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +254,11 @@ partial void ProcessCancelJobResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -236,14 +275,15 @@ partial void ProcessCancelJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -283,6 +323,8 @@ partial void ProcessCancelJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +345,8 @@ partial void ProcessCancelJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -365,9 +409,13 @@ partial void ProcessCancelJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Job.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Job.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -395,9 +443,13 @@ partial void ProcessCancelJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.JobsClient.DeleteJob.g.cs b/src/libs/Letta/Generated/Letta.JobsClient.DeleteJob.g.cs index 6e364e04..fbb463ca 100644 --- a/src/libs/Letta/Generated/Letta.JobsClient.DeleteJob.g.cs +++ b/src/libs/Letta/Generated/Letta.JobsClient.DeleteJob.g.cs @@ -68,6 +68,29 @@ partial void ProcessDeleteJobResponseContent( string jobId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Job
+ /// Delete a job by its job_id. + ///
+ /// + /// The ID of the job in the format 'job-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteJobAsResponseAsync( + string jobId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessDeleteJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/jobs/{jobId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessDeleteJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessDeleteJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessDeleteJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessDeleteJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessDeleteJobResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessDeleteJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessDeleteJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessDeleteJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessDeleteJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Job.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Job.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessDeleteJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.JobsClient.ListJobs.g.cs b/src/libs/Letta/Generated/Letta.JobsClient.ListJobs.g.cs index c43f5e70..1085eb3c 100644 --- a/src/libs/Letta/Generated/Letta.JobsClient.ListJobs.g.cs +++ b/src/libs/Letta/Generated/Letta.JobsClient.ListJobs.g.cs @@ -117,6 +117,69 @@ partial void ProcessListJobsResponseContent( bool? ascending = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListJobsAsResponseAsync( + sourceId: sourceId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + active: active, + ascending: ascending, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Jobs
+ /// List all jobs. + ///
+ /// + /// Deprecated: Use `folder_id` parameter instead. Only list jobs associated with the source. + /// + /// + /// Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order + /// + /// + /// Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order + /// + /// + /// Maximum number of jobs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter for active jobs.
+ /// Default Value: false + /// + /// + /// Whether to sort jobs oldest to newest (True, default) or newest to oldest (False). Deprecated in favor of order field.
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListJobsAsResponseAsync( + string? sourceId = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListJobsOrder? order = default, + string? orderBy = default, + bool? active = default, + bool? ascending = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -153,11 +216,12 @@ partial void ProcessListJobsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/jobs/", baseUri: ResolveBaseUri( servers: s_ListJobsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("source_id", sourceId) .AddOptionalParameter("before", before) @@ -166,7 +230,7 @@ partial void ProcessListJobsResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("active", active?.ToString().ToLowerInvariant()) - .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) + .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -245,6 +309,8 @@ partial void ProcessListJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -255,6 +321,11 @@ partial void ProcessListJobsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -272,6 +343,8 @@ partial void ProcessListJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -281,8 +354,7 @@ partial void ProcessListJobsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +363,11 @@ partial void ProcessListJobsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -307,14 +384,15 @@ partial void ProcessListJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -354,6 +432,8 @@ partial void ProcessListJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -374,6 +454,8 @@ partial void ProcessListJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -436,9 +518,13 @@ partial void ProcessListJobsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -466,9 +552,13 @@ partial void ProcessListJobsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.JobsClient.RetrieveJob.g.cs b/src/libs/Letta/Generated/Letta.JobsClient.RetrieveJob.g.cs index 85a14760..bcf2a3c4 100644 --- a/src/libs/Letta/Generated/Letta.JobsClient.RetrieveJob.g.cs +++ b/src/libs/Letta/Generated/Letta.JobsClient.RetrieveJob.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveJobResponseContent( string jobId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Job
+ /// Get the status of a job. + ///
+ /// + /// The ID of the job in the format 'job-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveJobAsResponseAsync( + string jobId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/jobs/{jobId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveJobResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Job.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Job.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Job.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.JobsClient.g.cs b/src/libs/Letta/Generated/Letta.JobsClient.g.cs index 0aa502d7..30c30d72 100644 --- a/src/libs/Letta/Generated/Letta.JobsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.JobsClient.g.cs @@ -103,10 +103,10 @@ public JobsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public JobsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.LettaClient.g.cs b/src/libs/Letta/Generated/Letta.LettaClient.g.cs index 39cc0ce6..4bbc7ab5 100644 --- a/src/libs/Letta/Generated/Letta.LettaClient.g.cs +++ b/src/libs/Letta/Generated/Letta.LettaClient.g.cs @@ -45,7 +45,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public AgentsClient Agents => new AgentsClient(HttpClient, authorizations: Authorizations, options: Options) + public AgentsClient Agents => new AgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -55,7 +55,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ArchivesClient Archives => new ArchivesClient(HttpClient, authorizations: Authorizations, options: Options) + public ArchivesClient Archives => new ArchivesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -65,7 +65,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public BlocksClient Blocks => new BlocksClient(HttpClient, authorizations: Authorizations, options: Options) + public BlocksClient Blocks => new BlocksClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -75,7 +75,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ChatClient Chat => new ChatClient(HttpClient, authorizations: Authorizations, options: Options) + public ChatClient Chat => new ChatClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -85,7 +85,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ClientSideAccessTokensClient ClientSideAccessTokens => new ClientSideAccessTokensClient(HttpClient, authorizations: Authorizations, options: Options) + public ClientSideAccessTokensClient ClientSideAccessTokens => new ClientSideAccessTokensClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -95,7 +95,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ConversationsClient Conversations => new ConversationsClient(HttpClient, authorizations: Authorizations, options: Options) + public ConversationsClient Conversations => new ConversationsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -105,7 +105,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public DeviceStorageClient DeviceStorage => new DeviceStorageClient(HttpClient, authorizations: Authorizations, options: Options) + public DeviceStorageClient DeviceStorage => new DeviceStorageClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -115,7 +115,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, authorizations: Authorizations, options: Options) + public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -125,7 +125,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public EnvironmentsClient Environments => new EnvironmentsClient(HttpClient, authorizations: Authorizations, options: Options) + public EnvironmentsClient Environments => new EnvironmentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -135,7 +135,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public FeedsClient Feeds => new FeedsClient(HttpClient, authorizations: Authorizations, options: Options) + public FeedsClient Feeds => new FeedsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -145,7 +145,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public FoldersClient Folders => new FoldersClient(HttpClient, authorizations: Authorizations, options: Options) + public FoldersClient Folders => new FoldersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -155,7 +155,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public HealthClient Health => new HealthClient(HttpClient, authorizations: Authorizations, options: Options) + public HealthClient Health => new HealthClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -165,7 +165,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public InternalAgentsClient InternalAgents => new InternalAgentsClient(HttpClient, authorizations: Authorizations, options: Options) + public InternalAgentsClient InternalAgents => new InternalAgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -175,7 +175,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public InternalBlocksClient InternalBlocks => new InternalBlocksClient(HttpClient, authorizations: Authorizations, options: Options) + public InternalBlocksClient InternalBlocks => new InternalBlocksClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -185,7 +185,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public InternalRunsClient InternalRuns => new InternalRunsClient(HttpClient, authorizations: Authorizations, options: Options) + public InternalRunsClient InternalRuns => new InternalRunsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -195,7 +195,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public InternalTemplatesClient InternalTemplates => new InternalTemplatesClient(HttpClient, authorizations: Authorizations, options: Options) + public InternalTemplatesClient InternalTemplates => new InternalTemplatesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -205,7 +205,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public JobsClient Jobs => new JobsClient(HttpClient, authorizations: Authorizations, options: Options) + public JobsClient Jobs => new JobsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -215,7 +215,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public McpServersClient McpServers => new McpServersClient(HttpClient, authorizations: Authorizations, options: Options) + public McpServersClient McpServers => new McpServersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -225,7 +225,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public MemoryFilesClient MemoryFiles => new MemoryFilesClient(HttpClient, authorizations: Authorizations, options: Options) + public MemoryFilesClient MemoryFiles => new MemoryFilesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -235,7 +235,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public MessagesClient Messages => new MessagesClient(HttpClient, authorizations: Authorizations, options: Options) + public MessagesClient Messages => new MessagesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -245,7 +245,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public MetadataClient Metadata => new MetadataClient(HttpClient, authorizations: Authorizations, options: Options) + public MetadataClient Metadata => new MetadataClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -255,7 +255,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ModelsClient Models => new ModelsClient(HttpClient, authorizations: Authorizations, options: Options) + public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -265,7 +265,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public PassagesClient Passages => new PassagesClient(HttpClient, authorizations: Authorizations, options: Options) + public PassagesClient Passages => new PassagesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -275,7 +275,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public PipelinesClient Pipelines => new PipelinesClient(HttpClient, authorizations: Authorizations, options: Options) + public PipelinesClient Pipelines => new PipelinesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -285,7 +285,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ProjectsClient Projects => new ProjectsClient(HttpClient, authorizations: Authorizations, options: Options) + public ProjectsClient Projects => new ProjectsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -295,7 +295,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ProvidersClient Providers => new ProvidersClient(HttpClient, authorizations: Authorizations, options: Options) + public ProvidersClient Providers => new ProvidersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -305,7 +305,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public RunsClient Runs => new RunsClient(HttpClient, authorizations: Authorizations, options: Options) + public RunsClient Runs => new RunsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -315,7 +315,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public SandboxesClient Sandboxes => new SandboxesClient(HttpClient, authorizations: Authorizations, options: Options) + public SandboxesClient Sandboxes => new SandboxesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -325,7 +325,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ScheduledMessagesClient ScheduledMessages => new ScheduledMessagesClient(HttpClient, authorizations: Authorizations, options: Options) + public ScheduledMessagesClient ScheduledMessages => new ScheduledMessagesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -335,7 +335,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public StepsClient Steps => new StepsClient(HttpClient, authorizations: Authorizations, options: Options) + public StepsClient Steps => new StepsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -345,7 +345,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public TagClient Tag => new TagClient(HttpClient, authorizations: Authorizations, options: Options) + public TagClient Tag => new TagClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -355,7 +355,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public TemplatesClient Templates => new TemplatesClient(HttpClient, authorizations: Authorizations, options: Options) + public TemplatesClient Templates => new TemplatesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -365,7 +365,7 @@ public sealed partial class LettaClient : global::Letta.ILettaClient, global::Sy /// /// /// - public ToolsClient Tools => new ToolsClient(HttpClient, authorizations: Authorizations, options: Options) + public ToolsClient Tools => new ToolsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -433,10 +433,10 @@ public LettaClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public LettaClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpConnectMcpServer.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpConnectMcpServer.g.cs index 3e9a26ec..fff270c7 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpConnectMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpConnectMcpServer.g.cs @@ -67,6 +67,28 @@ partial void ProcessMcpConnectMcpServerResponseContent( string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpConnectMcpServerAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Connect Mcp Server
+ /// Connect to an MCP server with support for OAuth via SSE.
+ /// Returns a stream of events handling authorization state and exchange if OAuth is required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> McpConnectMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +118,7 @@ partial void ProcessMcpConnectMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/connect/{mcpServerId}", baseUri: ResolveBaseUri( @@ -171,6 +194,8 @@ partial void ProcessMcpConnectMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +206,11 @@ partial void ProcessMcpConnectMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -198,6 +228,8 @@ partial void ProcessMcpConnectMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +239,7 @@ partial void ProcessMcpConnectMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +248,11 @@ partial void ProcessMcpConnectMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -233,14 +269,15 @@ partial void ProcessMcpConnectMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +317,8 @@ partial void ProcessMcpConnectMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +339,8 @@ partial void ProcessMcpConnectMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,7 +403,11 @@ partial void ProcessMcpConnectMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -390,7 +435,11 @@ partial void ProcessMcpConnectMcpServerResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpCreateMcpServer.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpCreateMcpServer.g.cs index e830ec8b..1b1f4990 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpCreateMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpCreateMcpServer.g.cs @@ -64,6 +64,29 @@ partial void ProcessMcpCreateMcpServerResponseContent( /// public async global::System.Threading.Tasks.Task> McpCreateMcpServerAsync( + global::Letta.CreateMCPServerRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpCreateMcpServerAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Mcp Server
+ /// Add a new MCP server to the Letta MCP server config + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> McpCreateMcpServerAsResponseAsync( + global::Letta.CreateMCPServerRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessMcpCreateMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/mcp-servers/", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessMcpCreateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessMcpCreateMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessMcpCreateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessMcpCreateMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessMcpCreateMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessMcpCreateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessMcpCreateMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessMcpCreateMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessMcpCreateMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessMcpCreateMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpDeleteMcpServer.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpDeleteMcpServer.g.cs index d5d14e33..a3e1d269 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpDeleteMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpDeleteMcpServer.g.cs @@ -61,6 +61,25 @@ partial void ProcessMcpDeleteMcpServerResponse( string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await McpDeleteMcpServerAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete Mcp Server
+ /// Delete an MCP server by its ID + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task McpDeleteMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +109,7 @@ partial void ProcessMcpDeleteMcpServerResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}", baseUri: ResolveBaseUri( @@ -165,6 +185,8 @@ partial void ProcessMcpDeleteMcpServerResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +197,11 @@ partial void ProcessMcpDeleteMcpServerResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -192,6 +219,8 @@ partial void ProcessMcpDeleteMcpServerResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +230,7 @@ partial void ProcessMcpDeleteMcpServerResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +239,11 @@ partial void ProcessMcpDeleteMcpServerResponse( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -227,14 +260,15 @@ partial void ProcessMcpDeleteMcpServerResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -274,6 +308,8 @@ partial void ProcessMcpDeleteMcpServerResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +330,8 @@ partial void ProcessMcpDeleteMcpServerResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -352,6 +390,10 @@ partial void ProcessMcpDeleteMcpServerResponse( { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -373,6 +415,10 @@ partial void ProcessMcpDeleteMcpServerResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpListMcpServers.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpListMcpServers.g.cs index ff17ff58..1a1457a4 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpListMcpServers.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpListMcpServers.g.cs @@ -62,6 +62,24 @@ partial void ProcessMcpListMcpServersResponseContent( public async global::System.Threading.Tasks.Task>> McpListMcpServersAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpListMcpServersAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Mcp Servers
+ /// Get a list of all configured MCP servers + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>>> McpListMcpServersAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessMcpListMcpServersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/mcp-servers/", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessMcpListMcpServersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessMcpListMcpServersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessMcpListMcpServersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessMcpListMcpServersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessMcpListMcpServersResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessMcpListMcpServersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessMcpListMcpServersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessMcpListMcpServersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -355,9 +392,13 @@ partial void ProcessMcpListMcpServersResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -385,9 +426,13 @@ partial void ProcessMcpListMcpServersResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpListToolsForMcpServer.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpListToolsForMcpServer.g.cs index a1de4126..ae18e656 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpListToolsForMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpListToolsForMcpServer.g.cs @@ -66,6 +66,27 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpListToolsForMcpServerAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Tools For Mcp Server
+ /// Get a list of all tools for a specific MCP server + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> McpListToolsForMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}/tools", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessMcpListToolsForMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpRefreshMcpServerTools.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpRefreshMcpServerTools.g.cs index 88285026..ea249fda 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpRefreshMcpServerTools.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpRefreshMcpServerTools.g.cs @@ -75,6 +75,35 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpRefreshMcpServerToolsAsResponseAsync( + mcpServerId: mcpServerId, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Refresh Mcp Server Tools
+ /// Refresh tools for an MCP server by:
+ /// 1. Fetching current tools from the MCP server
+ /// 2. Deleting tools that no longer exist on the server
+ /// 3. Updating schemas for existing tools
+ /// 4. Adding new tools from the server
+ /// Returns a summary of changes made. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> McpRefreshMcpServerToolsAsResponseAsync( + string mcpServerId, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,13 +134,14 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}/refresh", baseUri: ResolveBaseUri( servers: s_McpRefreshMcpServerToolsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -184,6 +214,8 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +226,11 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +248,8 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +259,7 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +268,11 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +289,15 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +337,8 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +359,8 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -375,7 +423,11 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -403,7 +455,11 @@ partial void ProcessMcpRefreshMcpServerToolsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpServer.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpServer.g.cs index a56d6452..dbfb54b7 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpServer.g.cs @@ -66,6 +66,27 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( string mcpServerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpRetrieveMcpServerAsResponseAsync( + mcpServerId: mcpServerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Mcp Server
+ /// Get a specific MCP server + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> McpRetrieveMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessMcpRetrieveMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpTool.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpTool.g.cs index 9633ae8e..2343a0b3 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpTool.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpRetrieveMcpTool.g.cs @@ -70,6 +70,30 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( string toolId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpRetrieveMcpToolAsResponseAsync( + mcpServerId: mcpServerId, + toolId: toolId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Mcp Tool
+ /// Get a specific MCP tool by its ID + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> McpRetrieveMcpToolAsResponseAsync( + string mcpServerId, + string toolId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}/tools/{toolId}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -367,9 +410,13 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,9 +444,13 @@ partial void ProcessMcpRetrieveMcpToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpRunTool.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpRunTool.g.cs index 5aa6fdfe..716dab16 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpRunTool.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpRunTool.g.cs @@ -73,6 +73,36 @@ partial void ProcessMcpRunToolResponseContent( string mcpServerId, string toolId, + global::Letta.LettaSchemasMcpServerToolExecuteRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpRunToolAsResponseAsync( + mcpServerId: mcpServerId, + toolId: toolId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Mcp Tool
+ /// Execute a specific MCP tool
+ /// The request body should contain the tool arguments in the ToolExecuteRequest format. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> McpRunToolAsResponseAsync( + string mcpServerId, + string toolId, + global::Letta.LettaSchemasMcpServerToolExecuteRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -109,6 +139,7 @@ partial void ProcessMcpRunToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}/tools/{toolId}/run", baseUri: ResolveBaseUri( @@ -192,6 +223,8 @@ partial void ProcessMcpRunToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +235,11 @@ partial void ProcessMcpRunToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +257,8 @@ partial void ProcessMcpRunToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +268,7 @@ partial void ProcessMcpRunToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +277,11 @@ partial void ProcessMcpRunToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +298,15 @@ partial void ProcessMcpRunToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +346,8 @@ partial void ProcessMcpRunToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +368,8 @@ partial void ProcessMcpRunToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -383,9 +432,13 @@ partial void ProcessMcpRunToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ToolExecutionResult.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ToolExecutionResult.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -413,9 +466,13 @@ partial void ProcessMcpRunToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ToolExecutionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ToolExecutionResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.McpUpdateMcpServer.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.McpUpdateMcpServer.g.cs index d102f8da..55d52ce8 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.McpUpdateMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.McpUpdateMcpServer.g.cs @@ -68,6 +68,32 @@ partial void ProcessMcpUpdateMcpServerResponseContent( public async global::System.Threading.Tasks.Task> McpUpdateMcpServerAsync( string mcpServerId, + global::Letta.UpdateMCPServerRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpUpdateMcpServerAsResponseAsync( + mcpServerId: mcpServerId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Mcp Server
+ /// Update an existing MCP server configuration + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> McpUpdateMcpServerAsResponseAsync( + string mcpServerId, + global::Letta.UpdateMCPServerRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessMcpUpdateMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/mcp-servers/{mcpServerId}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessMcpUpdateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessMcpUpdateMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessMcpUpdateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessMcpUpdateMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessMcpUpdateMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessMcpUpdateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessMcpUpdateMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessMcpUpdateMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -376,9 +421,13 @@ partial void ProcessMcpUpdateMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessMcpUpdateMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.McpServersClient.g.cs b/src/libs/Letta/Generated/Letta.McpServersClient.g.cs index 11ddf428..547a89d8 100644 --- a/src/libs/Letta/Generated/Letta.McpServersClient.g.cs +++ b/src/libs/Letta/Generated/Letta.McpServersClient.g.cs @@ -103,10 +103,10 @@ public McpServersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public McpServersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesGetFileHistory.g.cs b/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesGetFileHistory.g.cs index 4e3e70bc..19deaf93 100644 --- a/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesGetFileHistory.g.cs +++ b/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesGetFileHistory.g.cs @@ -74,6 +74,33 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( double? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MemoryFilesGetFileHistoryAsResponseAsync( + agentId: agentId, + filePath: filePath, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File History
+ /// Get commit history for a specific file in the agent memory repo. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MemoryFilesGetFileHistoryAsResponseAsync( + string agentId, + string filePath, + double? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,14 +132,15 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/memory-files/history", baseUri: ResolveBaseUri( servers: s_MemoryFilesGetFileHistoryServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddRequiredParameter("file_path", filePath) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -186,6 +214,8 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -415,9 +461,13 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MemoryFilesGetFileHistoryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MemoryFilesGetFileHistoryResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -445,9 +495,13 @@ partial void ProcessMemoryFilesGetFileHistoryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MemoryFilesGetFileHistoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MemoryFilesGetFileHistoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesListDirectory.g.cs b/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesListDirectory.g.cs index 3736a667..ddb3c93d 100644 --- a/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesListDirectory.g.cs +++ b/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesListDirectory.g.cs @@ -78,6 +78,36 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( string? @ref = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MemoryFilesListDirectoryAsResponseAsync( + agentId: agentId, + path: path, + depth: depth, + @ref: @ref, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Directory
+ /// List immediate children of a directory in the agent memory repo (single level). + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MemoryFilesListDirectoryAsResponseAsync( + string agentId, + string? path = default, + double? depth = default, + string? @ref = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,15 +140,16 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/memory-files/directory", baseUri: ResolveBaseUri( servers: s_MemoryFilesListDirectoryServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("path", path) .AddOptionalParameter("depth", depth?.ToString()) - .AddOptionalParameter("ref", @ref) + .AddOptionalParameter("ref", @ref) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -193,6 +224,8 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +236,11 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -220,6 +258,8 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +269,7 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +278,11 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -255,14 +299,15 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -302,6 +347,8 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +369,8 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -422,9 +471,13 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MemoryFilesListDirectoryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MemoryFilesListDirectoryResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -452,9 +505,13 @@ partial void ProcessMemoryFilesListDirectoryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MemoryFilesListDirectoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MemoryFilesListDirectoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesReadFileContent.g.cs b/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesReadFileContent.g.cs index b47744a6..3bf830e2 100644 --- a/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesReadFileContent.g.cs +++ b/src/libs/Letta/Generated/Letta.MemoryFilesClient.MemoryFilesReadFileContent.g.cs @@ -74,6 +74,33 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( string? @ref = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MemoryFilesReadFileContentAsResponseAsync( + agentId: agentId, + filePath: filePath, + @ref: @ref, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Read File Content
+ /// Read a single file content at a specific git ref from the agent memory repo. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MemoryFilesReadFileContentAsResponseAsync( + string agentId, + string filePath, + string? @ref = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,14 +132,15 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/memory-files/content", baseUri: ResolveBaseUri( servers: s_MemoryFilesReadFileContentServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddRequiredParameter("file_path", filePath) - .AddOptionalParameter("ref", @ref) + .AddOptionalParameter("ref", @ref) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -186,6 +214,8 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -415,9 +461,13 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MemoryFilesReadFileContentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MemoryFilesReadFileContentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -445,9 +495,13 @@ partial void ProcessMemoryFilesReadFileContentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MemoryFilesReadFileContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MemoryFilesReadFileContentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MemoryFilesClient.g.cs b/src/libs/Letta/Generated/Letta.MemoryFilesClient.g.cs index 5b0e3455..1e945f33 100644 --- a/src/libs/Letta/Generated/Letta.MemoryFilesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.MemoryFilesClient.g.cs @@ -103,10 +103,10 @@ public MemoryFilesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public MemoryFilesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.CancelBatch.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.CancelBatch.g.cs index ca66d0d0..fc9d0842 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.CancelBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.CancelBatch.g.cs @@ -66,6 +66,27 @@ partial void ProcessCancelBatchResponseContent( string batchId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelBatchAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel Batch
+ /// Cancel a batch run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CancelBatchAsResponseAsync( + string batchId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessCancelBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/messages/batches/{batchId}/cancel", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessCancelBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessCancelBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessCancelBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessCancelBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessCancelBatchResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessCancelBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessCancelBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessCancelBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,7 +401,11 @@ partial void ProcessCancelBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -389,7 +433,11 @@ partial void ProcessCancelBatchResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.CreateBatch.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.CreateBatch.g.cs index 4d55a851..7113301c 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.CreateBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.CreateBatch.g.cs @@ -66,6 +66,31 @@ partial void ProcessCreateBatchResponseContent( /// public async global::System.Threading.Tasks.Task CreateBatchAsync( + global::Letta.CreateBatch request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateBatchAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Batch
+ /// Submit a batch of agent runs for asynchronous processing.
+ /// Creates a job that will fan out messages to all listed agents and process them in parallel.
+ /// The request will be rejected if it exceeds 256MB. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateBatchAsResponseAsync( + global::Letta.CreateBatch request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -100,6 +125,7 @@ partial void ProcessCreateBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/messages/batches", baseUri: ResolveBaseUri( @@ -181,6 +207,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +219,11 @@ partial void ProcessCreateBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +241,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +252,7 @@ partial void ProcessCreateBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +261,11 @@ partial void ProcessCreateBatchResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +282,15 @@ partial void ProcessCreateBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +330,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +352,8 @@ partial void ProcessCreateBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -372,9 +416,13 @@ partial void ProcessCreateBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BatchJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BatchJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -402,9 +450,13 @@ partial void ProcessCreateBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BatchJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BatchJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.ListAllMessages.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.ListAllMessages.g.cs index e0aa0501..af0c1b8b 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.ListAllMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.ListAllMessages.g.cs @@ -100,6 +100,56 @@ partial void ProcessListAllMessagesResponseContent( global::System.Collections.Generic.IList? includeReturnMessageTypes = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListAllMessagesAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + conversationId: conversationId, + includeReturnMessageTypes: includeReturnMessageTypes, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List All Messages
+ /// List messages across all agents for the current user. + ///
+ /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Conversation ID to filter messages by + /// + /// + /// Message types to include in response. When null, all message types are returned. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListAllMessagesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListAllMessagesOrder? order = default, + string? conversationId = default, + global::System.Collections.Generic.IList? includeReturnMessageTypes = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -134,18 +184,19 @@ partial void ProcessListAllMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/messages/", baseUri: ResolveBaseUri( servers: s_ListAllMessagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("conversation_id", conversationId) - .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString()) + .AddOptionalParameter("include_return_message_types", includeReturnMessageTypes?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +273,8 @@ partial void ProcessListAllMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +285,11 @@ partial void ProcessListAllMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +307,8 @@ partial void ProcessListAllMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +318,7 @@ partial void ProcessListAllMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +327,11 @@ partial void ProcessListAllMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +348,15 @@ partial void ProcessListAllMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +396,8 @@ partial void ProcessListAllMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +418,8 @@ partial void ProcessListAllMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +482,13 @@ partial void ProcessListAllMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +516,13 @@ partial void ProcessListAllMessagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.ListBatches.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.ListBatches.g.cs index 975ebec9..94f072fb 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.ListBatches.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.ListBatches.g.cs @@ -95,6 +95,52 @@ partial void ProcessListBatchesResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListBatchesAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Batches
+ /// List all batch runs. + ///
+ /// + /// Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order + /// + /// + /// Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order + /// + /// + /// Maximum number of jobs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListBatchesAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListBatchesOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -128,17 +174,18 @@ partial void ProcessListBatchesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/messages/batches", baseUri: ResolveBaseUri( servers: s_ListBatchesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -214,6 +261,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -224,6 +273,11 @@ partial void ProcessListBatchesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -241,6 +295,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -250,8 +306,7 @@ partial void ProcessListBatchesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -260,6 +315,11 @@ partial void ProcessListBatchesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -276,14 +336,15 @@ partial void ProcessListBatchesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -323,6 +384,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -343,6 +406,8 @@ partial void ProcessListBatchesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -405,9 +470,13 @@ partial void ProcessListBatchesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -435,9 +504,13 @@ partial void ProcessListBatchesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.ListMessagesForBatch.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.ListMessagesForBatch.g.cs index ca88b00c..00828b97 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.ListMessagesForBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.ListMessagesForBatch.g.cs @@ -105,6 +105,60 @@ partial void ProcessListMessagesForBatchResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMessagesForBatchAsResponseAsync( + batchId: batchId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Messages For Batch
+ /// Get response messages for a specific batch job. + ///
+ /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter messages by agent ID + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListMessagesForBatchAsResponseAsync( + string batchId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesForBatchOrder? order = default, + string? orderBy = default, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -140,18 +194,19 @@ partial void ProcessListMessagesForBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/messages/batches/{batchId}/messages", baseUri: ResolveBaseUri( servers: s_ListMessagesForBatchServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -229,6 +284,8 @@ partial void ProcessListMessagesForBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -239,6 +296,11 @@ partial void ProcessListMessagesForBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -256,6 +318,8 @@ partial void ProcessListMessagesForBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -265,8 +329,7 @@ partial void ProcessListMessagesForBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +338,11 @@ partial void ProcessListMessagesForBatchResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -291,14 +359,15 @@ partial void ProcessListMessagesForBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -338,6 +407,8 @@ partial void ProcessListMessagesForBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -358,6 +429,8 @@ partial void ProcessListMessagesForBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -420,9 +493,13 @@ partial void ProcessListMessagesForBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.LettaBatchMessages.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.LettaBatchMessages.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -450,9 +527,13 @@ partial void ProcessListMessagesForBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.LettaBatchMessages.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.LettaBatchMessages.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveBatch.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveBatch.g.cs index 48c67aa1..2a45cf20 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveBatch.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveBatch.g.cs @@ -66,6 +66,27 @@ partial void ProcessRetrieveBatchResponseContent( string batchId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveBatchAsResponseAsync( + batchId: batchId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Batch
+ /// Retrieve the status and details of a batch run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveBatchAsResponseAsync( + string batchId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessRetrieveBatchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/messages/batches/{batchId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessRetrieveBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessRetrieveBatchResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessRetrieveBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessRetrieveBatchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessRetrieveBatchResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessRetrieveBatchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessRetrieveBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessRetrieveBatchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessRetrieveBatchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.BatchJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.BatchJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessRetrieveBatchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.BatchJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.BatchJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveMessage.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveMessage.g.cs index f73dfae9..b7042afc 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.RetrieveMessage.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveMessageResponseContent( string messageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveMessageAsResponseAsync( + messageId: messageId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Message
+ /// Retrieve a message by ID. + ///
+ /// + /// The ID of the message in the format 'message-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> RetrieveMessageAsResponseAsync( + string messageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/messages/{messageId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveMessageResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.SearchAllMessages.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.SearchAllMessages.g.cs index d98ce42a..21480823 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.SearchAllMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.SearchAllMessages.g.cs @@ -66,6 +66,31 @@ partial void ProcessSearchAllMessagesResponseContent( /// public async global::System.Threading.Tasks.Task> SearchAllMessagesAsync( + global::Letta.SearchAllMessagesRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchAllMessagesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search All Messages
+ /// Search messages across the organization with optional agent filtering.
+ /// Returns messages with FTS/vector ranks and total RRF score.
+ /// This is a cloud-only feature. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> SearchAllMessagesAsResponseAsync( + global::Letta.SearchAllMessagesRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -100,6 +125,7 @@ partial void ProcessSearchAllMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/messages/search", baseUri: ResolveBaseUri( @@ -181,6 +207,8 @@ partial void ProcessSearchAllMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +219,11 @@ partial void ProcessSearchAllMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -208,6 +241,8 @@ partial void ProcessSearchAllMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +252,7 @@ partial void ProcessSearchAllMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +261,11 @@ partial void ProcessSearchAllMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -243,14 +282,15 @@ partial void ProcessSearchAllMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +330,8 @@ partial void ProcessSearchAllMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +352,8 @@ partial void ProcessSearchAllMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -372,9 +416,13 @@ partial void ProcessSearchAllMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -402,9 +450,13 @@ partial void ProcessSearchAllMessagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MessagesClient.g.cs b/src/libs/Letta/Generated/Letta.MessagesClient.g.cs index 104cc0ea..d023409e 100644 --- a/src/libs/Letta/Generated/Letta.MessagesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.MessagesClient.g.cs @@ -103,10 +103,10 @@ public MessagesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public MessagesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetStatus.g.cs b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetStatus.g.cs index e31e25ca..e5eb3d63 100644 --- a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetStatus.g.cs +++ b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetStatus.g.cs @@ -61,6 +61,23 @@ partial void ProcessMetadataGetStatusResponseContent( public async global::System.Threading.Tasks.Task MetadataGetStatusAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MetadataGetStatusAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gets your Letta Cloud status + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MetadataGetStatusAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -89,6 +106,7 @@ partial void ProcessMetadataGetStatusResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/metadata/status", baseUri: ResolveBaseUri( @@ -163,6 +181,8 @@ partial void ProcessMetadataGetStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +193,11 @@ partial void ProcessMetadataGetStatusResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -190,6 +215,8 @@ partial void ProcessMetadataGetStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -199,8 +226,7 @@ partial void ProcessMetadataGetStatusResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -209,6 +235,11 @@ partial void ProcessMetadataGetStatusResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -225,14 +256,15 @@ partial void ProcessMetadataGetStatusResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -272,6 +304,8 @@ partial void ProcessMetadataGetStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +326,8 @@ partial void ProcessMetadataGetStatusResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -316,9 +352,13 @@ partial void ProcessMetadataGetStatusResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MetadataGetStatusResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MetadataGetStatusResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -346,9 +386,13 @@ partial void ProcessMetadataGetStatusResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MetadataGetStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MetadataGetStatusResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetUser.g.cs b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetUser.g.cs index 87a9044f..d470744d 100644 --- a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetUser.g.cs +++ b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataGetUser.g.cs @@ -62,6 +62,24 @@ partial void ProcessMetadataGetUserResponseContent( public async global::System.Threading.Tasks.Task MetadataGetUserAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MetadataGetUserAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get current user information
+ /// Retrieve information about the current authenticated user including email, name, organization, and current project. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MetadataGetUserAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessMetadataGetUserResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/metadata/user", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessMetadataGetUserResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessMetadataGetUserResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessMetadataGetUserResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessMetadataGetUserResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessMetadataGetUserResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessMetadataGetUserResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessMetadataGetUserResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessMetadataGetUserResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -355,9 +392,13 @@ partial void ProcessMetadataGetUserResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MetadataGetUserResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MetadataGetUserResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -385,9 +426,13 @@ partial void ProcessMetadataGetUserResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MetadataGetUserResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MetadataGetUserResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataRetrieveCurrentBalances.g.cs b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataRetrieveCurrentBalances.g.cs index d94fc04f..c1b3df4d 100644 --- a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataRetrieveCurrentBalances.g.cs +++ b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataRetrieveCurrentBalances.g.cs @@ -62,6 +62,24 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( public async global::System.Threading.Tasks.Task MetadataRetrieveCurrentBalancesAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MetadataRetrieveCurrentBalancesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve current organization balance
+ /// Retrieve the current usage balances for the organization. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MetadataRetrieveCurrentBalancesAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/metadata/balance", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -317,9 +354,13 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MetadataRetrieveCurrentBalancesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MetadataRetrieveCurrentBalancesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -347,9 +388,13 @@ partial void ProcessMetadataRetrieveCurrentBalancesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MetadataRetrieveCurrentBalancesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MetadataRetrieveCurrentBalancesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendFeedback.g.cs b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendFeedback.g.cs index 56c1ad35..afdf5b8c 100644 --- a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendFeedback.g.cs +++ b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendFeedback.g.cs @@ -64,6 +64,29 @@ partial void ProcessMetadataSendFeedbackResponseContent( /// public async global::System.Threading.Tasks.Task MetadataSendFeedbackAsync( + global::Letta.MetadataSendFeedbackRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MetadataSendFeedbackAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Send user feedback
+ /// Send feedback from users to improve our services. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MetadataSendFeedbackAsResponseAsync( + global::Letta.MetadataSendFeedbackRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessMetadataSendFeedbackResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/metadata/feedback", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessMetadataSendFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessMetadataSendFeedbackResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessMetadataSendFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessMetadataSendFeedbackResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessMetadataSendFeedbackResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessMetadataSendFeedbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessMetadataSendFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessMetadataSendFeedbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessMetadataSendFeedbackResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MetadataSendFeedbackResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MetadataSendFeedbackResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessMetadataSendFeedbackResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MetadataSendFeedbackResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MetadataSendFeedbackResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendTelemetry.g.cs b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendTelemetry.g.cs index de68ca13..86a78caf 100644 --- a/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendTelemetry.g.cs +++ b/src/libs/Letta/Generated/Letta.MetadataClient.MetadataSendTelemetry.g.cs @@ -64,6 +64,29 @@ partial void ProcessMetadataSendTelemetryResponseContent( /// public async global::System.Threading.Tasks.Task MetadataSendTelemetryAsync( + global::Letta.MetadataSendTelemetryRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MetadataSendTelemetryAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Send telemetry event
+ /// Send telemetry events for usage tracking and analysis. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> MetadataSendTelemetryAsResponseAsync( + global::Letta.MetadataSendTelemetryRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessMetadataSendTelemetryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/metadata/telemetry", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessMetadataSendTelemetryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessMetadataSendTelemetryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessMetadataSendTelemetryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessMetadataSendTelemetryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessMetadataSendTelemetryResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessMetadataSendTelemetryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessMetadataSendTelemetryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessMetadataSendTelemetryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessMetadataSendTelemetryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.MetadataSendTelemetryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.MetadataSendTelemetryResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessMetadataSendTelemetryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.MetadataSendTelemetryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.MetadataSendTelemetryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.MetadataClient.g.cs b/src/libs/Letta/Generated/Letta.MetadataClient.g.cs index a61f52ea..dcbfc8d3 100644 --- a/src/libs/Letta/Generated/Letta.MetadataClient.g.cs +++ b/src/libs/Letta/Generated/Letta.MetadataClient.g.cs @@ -103,10 +103,10 @@ public MetadataClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public MetadataClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ModelsClient.ListEmbeddingModels.g.cs b/src/libs/Letta/Generated/Letta.ModelsClient.ListEmbeddingModels.g.cs index 6da76c0b..1af75e32 100644 --- a/src/libs/Letta/Generated/Letta.ModelsClient.ListEmbeddingModels.g.cs +++ b/src/libs/Letta/Generated/Letta.ModelsClient.ListEmbeddingModels.g.cs @@ -64,6 +64,26 @@ partial void ProcessListEmbeddingModelsResponseContent( public async global::System.Threading.Tasks.Task> ListEmbeddingModelsAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListEmbeddingModelsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Embedding Models
+ /// List available embedding models using the asynchronous implementation for improved performance.
+ /// Returns EmbeddingModel format which extends EmbeddingConfig with additional metadata fields.
+ /// Legacy EmbeddingConfig fields are marked as deprecated but still available for backward compatibility. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListEmbeddingModelsAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -92,6 +112,7 @@ partial void ProcessListEmbeddingModelsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/models/embedding", baseUri: ResolveBaseUri( @@ -166,6 +187,8 @@ partial void ProcessListEmbeddingModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +199,11 @@ partial void ProcessListEmbeddingModelsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -193,6 +221,8 @@ partial void ProcessListEmbeddingModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +232,7 @@ partial void ProcessListEmbeddingModelsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +241,11 @@ partial void ProcessListEmbeddingModelsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -228,14 +262,15 @@ partial void ProcessListEmbeddingModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -275,6 +310,8 @@ partial void ProcessListEmbeddingModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +332,8 @@ partial void ProcessListEmbeddingModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -357,9 +396,13 @@ partial void ProcessListEmbeddingModelsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -387,9 +430,13 @@ partial void ProcessListEmbeddingModelsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ModelsClient.ListModels.g.cs b/src/libs/Letta/Generated/Letta.ModelsClient.ListModels.g.cs index 8d03e3db..3a7b8669 100644 --- a/src/libs/Letta/Generated/Letta.ModelsClient.ListModels.g.cs +++ b/src/libs/Letta/Generated/Letta.ModelsClient.ListModels.g.cs @@ -76,6 +76,35 @@ partial void ProcessListModelsResponseContent( global::Letta.ProviderType? providerType = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListModelsAsResponseAsync( + providerCategory: providerCategory, + providerName: providerName, + providerType: providerType, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Llm Models
+ /// List available LLM models using the asynchronous implementation for improved performance.
+ /// Returns Model format which extends LLMConfig with additional metadata fields.
+ /// Legacy LLMConfig fields are marked as deprecated but still available for backward compatibility. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListModelsAsResponseAsync( + global::System.Collections.Generic.IList? providerCategory = default, + string? providerName = default, + global::Letta.ProviderType? providerType = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -107,15 +136,16 @@ partial void ProcessListModelsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/models/", baseUri: ResolveBaseUri( servers: s_ListModelsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("provider_category", providerCategory?.ToString()) .AddOptionalParameter("provider_name", providerName) - .AddOptionalParameter("provider_type", providerType?.ToString()) + .AddOptionalParameter("provider_type", providerType?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -189,6 +219,8 @@ partial void ProcessListModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -199,6 +231,11 @@ partial void ProcessListModelsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -216,6 +253,8 @@ partial void ProcessListModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -225,8 +264,7 @@ partial void ProcessListModelsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -235,6 +273,11 @@ partial void ProcessListModelsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -251,14 +294,15 @@ partial void ProcessListModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -298,6 +342,8 @@ partial void ProcessListModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -318,6 +364,8 @@ partial void ProcessListModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -380,9 +428,13 @@ partial void ProcessListModelsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -410,9 +462,13 @@ partial void ProcessListModelsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ModelsClient.ModelsListEmbeddingModels.g.cs b/src/libs/Letta/Generated/Letta.ModelsClient.ModelsListEmbeddingModels.g.cs index fd5decd0..e0d02fe6 100644 --- a/src/libs/Letta/Generated/Letta.ModelsClient.ModelsListEmbeddingModels.g.cs +++ b/src/libs/Letta/Generated/Letta.ModelsClient.ModelsListEmbeddingModels.g.cs @@ -56,6 +56,21 @@ partial void ProcessModelsListEmbeddingModelsResponse( public async global::System.Threading.Tasks.Task ModelsListEmbeddingModelsAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await ModelsListEmbeddingModelsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ModelsListEmbeddingModelsAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -84,6 +99,7 @@ partial void ProcessModelsListEmbeddingModelsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/models/embeddings", baseUri: ResolveBaseUri( @@ -158,6 +174,8 @@ partial void ProcessModelsListEmbeddingModelsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -168,6 +186,11 @@ partial void ProcessModelsListEmbeddingModelsResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -185,6 +208,8 @@ partial void ProcessModelsListEmbeddingModelsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -194,8 +219,7 @@ partial void ProcessModelsListEmbeddingModelsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -204,6 +228,11 @@ partial void ProcessModelsListEmbeddingModelsResponse( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -220,14 +249,15 @@ partial void ProcessModelsListEmbeddingModelsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -267,6 +297,8 @@ partial void ProcessModelsListEmbeddingModelsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -287,6 +319,8 @@ partial void ProcessModelsListEmbeddingModelsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -307,6 +341,10 @@ partial void ProcessModelsListEmbeddingModelsResponse( { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -328,6 +366,10 @@ partial void ProcessModelsListEmbeddingModelsResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ModelsClient.g.cs b/src/libs/Letta/Generated/Letta.ModelsClient.g.cs index e408e174..c3ed1855 100644 --- a/src/libs/Letta/Generated/Letta.ModelsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ModelsClient.g.cs @@ -103,10 +103,10 @@ public ModelsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ModelsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.OptionsSupport.g.cs b/src/libs/Letta/Generated/Letta.OptionsSupport.g.cs index a478b93d..3b226677 100644 --- a/src/libs/Letta/Generated/Letta.OptionsSupport.g.cs +++ b/src/libs/Letta/Generated/Letta.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::Letta.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::Letta.AutoSDKClientOptions clientOptions, global::Letta.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Letta.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::Letta.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/Letta/Generated/Letta.PassagesClient.SearchPassages.g.cs b/src/libs/Letta/Generated/Letta.PassagesClient.SearchPassages.g.cs index e0fa8d84..0519c1a6 100644 --- a/src/libs/Letta/Generated/Letta.PassagesClient.SearchPassages.g.cs +++ b/src/libs/Letta/Generated/Letta.PassagesClient.SearchPassages.g.cs @@ -70,6 +70,35 @@ partial void ProcessSearchPassagesResponseContent( /// public async global::System.Threading.Tasks.Task> SearchPassagesAsync( + global::Letta.PassageSearchRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchPassagesAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search Passages
+ /// Search passages across the organization with optional agent and archive filtering.
+ /// Returns passages with relevance scores.
+ /// This endpoint supports semantic search through passages:
+ /// - If neither agent_id nor archive_id is provided, searches ALL passages in the organization
+ /// - If agent_id is provided, searches passages across all archives attached to that agent
+ /// - If archive_id is provided, searches passages within that specific archive
+ /// - If both are provided, agent_id takes precedence + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> SearchPassagesAsResponseAsync( + global::Letta.PassageSearchRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -104,6 +133,7 @@ partial void ProcessSearchPassagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/passages/search", baseUri: ResolveBaseUri( @@ -185,6 +215,8 @@ partial void ProcessSearchPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +227,11 @@ partial void ProcessSearchPassagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +249,8 @@ partial void ProcessSearchPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +260,7 @@ partial void ProcessSearchPassagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +269,11 @@ partial void ProcessSearchPassagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +290,15 @@ partial void ProcessSearchPassagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +338,8 @@ partial void ProcessSearchPassagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +360,8 @@ partial void ProcessSearchPassagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -376,9 +424,13 @@ partial void ProcessSearchPassagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +458,13 @@ partial void ProcessSearchPassagesResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PassagesClient.g.cs b/src/libs/Letta/Generated/Letta.PassagesClient.g.cs index 2474d545..f9ae753f 100644 --- a/src/libs/Letta/Generated/Letta.PassagesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.PassagesClient.g.cs @@ -103,10 +103,10 @@ public PassagesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PassagesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCountPipelines.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCountPipelines.g.cs index 1b929812..4b46382a 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCountPipelines.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCountPipelines.g.cs @@ -74,6 +74,33 @@ partial void ProcessPipelinesCountPipelinesResponseContent( string? integrationId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesCountPipelinesAsResponseAsync( + search: search, + integrationType: integrationType, + integrationId: integrationId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Pipelines
+ /// Get the total count of pipelines, optionally filtered by project and search + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesCountPipelinesAsResponseAsync( + string? search = default, + string? integrationType = default, + string? integrationId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,15 +132,16 @@ partial void ProcessPipelinesCountPipelinesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/pipelines/count", baseUri: ResolveBaseUri( servers: s_PipelinesCountPipelinesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("search", search) .AddOptionalParameter("integration_type", integrationType) - .AddOptionalParameter("integration_id", integrationId) + .AddOptionalParameter("integration_id", integrationId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -187,6 +215,8 @@ partial void ProcessPipelinesCountPipelinesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +227,11 @@ partial void ProcessPipelinesCountPipelinesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +249,8 @@ partial void ProcessPipelinesCountPipelinesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +260,7 @@ partial void ProcessPipelinesCountPipelinesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +269,11 @@ partial void ProcessPipelinesCountPipelinesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +290,15 @@ partial void ProcessPipelinesCountPipelinesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +338,8 @@ partial void ProcessPipelinesCountPipelinesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +360,8 @@ partial void ProcessPipelinesCountPipelinesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -340,9 +386,13 @@ partial void ProcessPipelinesCountPipelinesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesCountPipelinesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesCountPipelinesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -370,9 +420,13 @@ partial void ProcessPipelinesCountPipelinesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesCountPipelinesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesCountPipelinesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCreatePipeline.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCreatePipeline.g.cs index 6617aae4..d3ca89b8 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCreatePipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesCreatePipeline.g.cs @@ -64,6 +64,29 @@ partial void ProcessPipelinesCreatePipelineResponseContent( /// public async global::System.Threading.Tasks.Task PipelinesCreatePipelineAsync( + global::Letta.PipelinesCreatePipelineRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesCreatePipelineAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Pipeline
+ /// Create a new pipeline (producer + feed + optionally subscribers) + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesCreatePipelineAsResponseAsync( + global::Letta.PipelinesCreatePipelineRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessPipelinesCreatePipelineResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/pipelines", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessPipelinesCreatePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessPipelinesCreatePipelineResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessPipelinesCreatePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessPipelinesCreatePipelineResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessPipelinesCreatePipelineResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessPipelinesCreatePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessPipelinesCreatePipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessPipelinesCreatePipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -370,9 +412,13 @@ partial void ProcessPipelinesCreatePipelineResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesCreatePipelineResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesCreatePipelineResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessPipelinesCreatePipelineResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesCreatePipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesCreatePipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesDeletePipeline.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesDeletePipeline.g.cs index eb62ba49..9de6c923 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesDeletePipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesDeletePipeline.g.cs @@ -68,6 +68,32 @@ partial void ProcessPipelinesDeletePipelineResponseContent( public async global::System.Threading.Tasks.Task PipelinesDeletePipelineAsync( string pipelineId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesDeletePipelineAsResponseAsync( + pipelineId: pipelineId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Pipeline
+ /// Soft delete a pipeline and cascade to feed + subscriptions + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesDeletePipelineAsResponseAsync( + string pipelineId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessPipelinesDeletePipelineResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/pipelines/{pipelineId}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessPipelinesDeletePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessPipelinesDeletePipelineResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessPipelinesDeletePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessPipelinesDeletePipelineResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessPipelinesDeletePipelineResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessPipelinesDeletePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessPipelinesDeletePipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessPipelinesDeletePipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -376,9 +421,13 @@ partial void ProcessPipelinesDeletePipelineResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesDeletePipelineResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesDeletePipelineResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessPipelinesDeletePipelineResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesDeletePipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesDeletePipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesGetPipeline.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesGetPipeline.g.cs index ca455091..58e4d4fb 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesGetPipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesGetPipeline.g.cs @@ -66,6 +66,27 @@ partial void ProcessPipelinesGetPipelineResponseContent( string pipelineId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesGetPipelineAsResponseAsync( + pipelineId: pipelineId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Pipeline
+ /// Get a single pipeline with details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesGetPipelineAsResponseAsync( + string pipelineId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessPipelinesGetPipelineResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/pipelines/{pipelineId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessPipelinesGetPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessPipelinesGetPipelineResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessPipelinesGetPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessPipelinesGetPipelineResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessPipelinesGetPipelineResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessPipelinesGetPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessPipelinesGetPipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessPipelinesGetPipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -361,9 +401,13 @@ partial void ProcessPipelinesGetPipelineResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesGetPipelineResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesGetPipelineResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessPipelinesGetPipelineResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesGetPipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesGetPipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelineSyncHistory.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelineSyncHistory.g.cs index ef40b5f0..97e26323 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelineSyncHistory.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelineSyncHistory.g.cs @@ -66,6 +66,27 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( string pipelineId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesListPipelineSyncHistoryAsResponseAsync( + pipelineId: pipelineId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Pipeline Sync History
+ /// List the sync run history for a pipeline from Temporal with error details + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesListPipelineSyncHistoryAsResponseAsync( + string pipelineId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/pipelines/{pipelineId}/sync/history", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -361,9 +401,13 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesListPipelineSyncHistoryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesListPipelineSyncHistoryResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessPipelinesListPipelineSyncHistoryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesListPipelineSyncHistoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesListPipelineSyncHistoryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelines.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelines.g.cs index 042d53bd..c98178d4 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelines.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesListPipelines.g.cs @@ -82,6 +82,39 @@ partial void ProcessPipelinesListPipelinesResponseContent( string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesListPipelinesAsResponseAsync( + search: search, + integrationType: integrationType, + integrationId: integrationId, + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Pipelines
+ /// List all pipelines for the organization with optional filtering + ///
+ /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesListPipelinesAsResponseAsync( + string? search = default, + string? integrationType = default, + string? integrationId = default, + global::Letta.OneOf? offset = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -115,17 +148,18 @@ partial void ProcessPipelinesListPipelinesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/pipelines", baseUri: ResolveBaseUri( servers: s_PipelinesListPipelinesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("search", search) .AddOptionalParameter("integration_type", integrationType) .AddOptionalParameter("integration_id", integrationId) .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit) + .AddOptionalParameter("limit", limit) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -201,6 +235,8 @@ partial void ProcessPipelinesListPipelinesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -211,6 +247,11 @@ partial void ProcessPipelinesListPipelinesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -228,6 +269,8 @@ partial void ProcessPipelinesListPipelinesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -237,8 +280,7 @@ partial void ProcessPipelinesListPipelinesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -247,6 +289,11 @@ partial void ProcessPipelinesListPipelinesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -263,14 +310,15 @@ partial void ProcessPipelinesListPipelinesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -310,6 +358,8 @@ partial void ProcessPipelinesListPipelinesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -330,6 +380,8 @@ partial void ProcessPipelinesListPipelinesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -354,9 +406,13 @@ partial void ProcessPipelinesListPipelinesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesListPipelinesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesListPipelinesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -384,9 +440,13 @@ partial void ProcessPipelinesListPipelinesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesListPipelinesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesListPipelinesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesPreviewPipeline.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesPreviewPipeline.g.cs index b8f549f1..62f3138f 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesPreviewPipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesPreviewPipeline.g.cs @@ -64,6 +64,29 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( /// public async global::System.Threading.Tasks.Task PipelinesPreviewPipelineAsync( + global::Letta.PipelinesPreviewPipelineRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesPreviewPipelineAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Preview Pipeline
+ /// Fetch sample messages from integration to preview what agents will receive + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesPreviewPipelineAsResponseAsync( + global::Letta.PipelinesPreviewPipelineRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/pipelines/preview", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -370,9 +412,13 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesPreviewPipelineResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesPreviewPipelineResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessPipelinesPreviewPipelineResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesPreviewPipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesPreviewPipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesSyncPipeline.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesSyncPipeline.g.cs index 13c5ca77..9f6f8ab5 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesSyncPipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesSyncPipeline.g.cs @@ -68,6 +68,32 @@ partial void ProcessPipelinesSyncPipelineResponseContent( public async global::System.Threading.Tasks.Task PipelinesSyncPipelineAsync( string pipelineId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesSyncPipelineAsResponseAsync( + pipelineId: pipelineId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Sync Pipeline
+ /// Manually trigger a pipeline sync to fetch new messages immediately + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesSyncPipelineAsResponseAsync( + string pipelineId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessPipelinesSyncPipelineResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/pipelines/{pipelineId}/sync", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessPipelinesSyncPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessPipelinesSyncPipelineResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessPipelinesSyncPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessPipelinesSyncPipelineResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessPipelinesSyncPipelineResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessPipelinesSyncPipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessPipelinesSyncPipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessPipelinesSyncPipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -414,9 +459,13 @@ partial void ProcessPipelinesSyncPipelineResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesSyncPipelineResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesSyncPipelineResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +493,13 @@ partial void ProcessPipelinesSyncPipelineResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesSyncPipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesSyncPipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipeline.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipeline.g.cs index 4af38d91..1dd1c241 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipeline.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipeline.g.cs @@ -68,6 +68,32 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( public async global::System.Threading.Tasks.Task PipelinesUpdatePipelineAsync( string pipelineId, + global::Letta.PipelinesUpdatePipelineRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesUpdatePipelineAsResponseAsync( + pipelineId: pipelineId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Pipeline
+ /// Update pipeline name or disable/enable it + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesUpdatePipelineAsResponseAsync( + string pipelineId, + global::Letta.PipelinesUpdatePipelineRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/pipelines/{pipelineId}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -376,9 +421,13 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesUpdatePipelineResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesUpdatePipelineResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessPipelinesUpdatePipelineResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesUpdatePipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesUpdatePipelineResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs index 241b42f7..5444f14b 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.PipelinesUpdatePipelineProducerConfig.g.cs @@ -68,6 +68,32 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( public async global::System.Threading.Tasks.Task PipelinesUpdatePipelineProducerConfigAsync( string pipelineId, + global::Letta.PipelinesUpdatePipelineProducerConfigRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PipelinesUpdatePipelineProducerConfigAsResponseAsync( + pipelineId: pipelineId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Pipeline Producer Config
+ /// Update the producer configuration for a pipeline (e.g., Slack channels) + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> PipelinesUpdatePipelineProducerConfigAsResponseAsync( + string pipelineId, + global::Letta.PipelinesUpdatePipelineProducerConfigRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/pipelines/{pipelineId}/config", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -414,9 +459,13 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.PipelinesUpdatePipelineProducerConfigResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.PipelinesUpdatePipelineProducerConfigResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +493,13 @@ partial void ProcessPipelinesUpdatePipelineProducerConfigResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.PipelinesUpdatePipelineProducerConfigResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.PipelinesUpdatePipelineProducerConfigResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.PipelinesClient.g.cs b/src/libs/Letta/Generated/Letta.PipelinesClient.g.cs index 361b812c..664fef83 100644 --- a/src/libs/Letta/Generated/Letta.PipelinesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.PipelinesClient.g.cs @@ -103,10 +103,10 @@ public PipelinesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PipelinesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsCreateProject.g.cs b/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsCreateProject.g.cs index 38063c78..869b33a2 100644 --- a/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsCreateProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsCreateProject.g.cs @@ -64,6 +64,29 @@ partial void ProcessProjectsCreateProjectResponseContent( /// public async global::System.Threading.Tasks.Task ProjectsCreateProjectAsync( + global::Letta.ProjectsCreateProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProjectsCreateProjectAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Project (Cloud-only)
+ /// Create a new project + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProjectsCreateProjectAsResponseAsync( + global::Letta.ProjectsCreateProjectRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessProjectsCreateProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/projects", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessProjectsCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessProjectsCreateProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessProjectsCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessProjectsCreateProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessProjectsCreateProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessProjectsCreateProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessProjectsCreateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessProjectsCreateProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -332,9 +374,13 @@ partial void ProcessProjectsCreateProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ProjectsCreateProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ProjectsCreateProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -362,9 +408,13 @@ partial void ProcessProjectsCreateProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ProjectsCreateProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ProjectsCreateProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsDeleteProject.g.cs b/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsDeleteProject.g.cs index 694695a3..60da4763 100644 --- a/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsDeleteProject.g.cs +++ b/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsDeleteProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessProjectsDeleteProjectResponseContent( public async global::System.Threading.Tasks.Task ProjectsDeleteProjectAsync( global::System.Guid projectId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProjectsDeleteProjectAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Project (Cloud-only)
+ /// Delete a project by ID + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProjectsDeleteProjectAsResponseAsync( + global::System.Guid projectId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessProjectsDeleteProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/projects/{projectId}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessProjectsDeleteProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessProjectsDeleteProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessProjectsDeleteProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessProjectsDeleteProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessProjectsDeleteProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessProjectsDeleteProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessProjectsDeleteProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessProjectsDeleteProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessProjectsDeleteProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ProjectsDeleteProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ProjectsDeleteProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessProjectsDeleteProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ProjectsDeleteProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ProjectsDeleteProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsListProjects.g.cs b/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsListProjects.g.cs index e5bdf0f5..0b06d8db 100644 --- a/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsListProjects.g.cs +++ b/src/libs/Letta/Generated/Letta.ProjectsClient.ProjectsListProjects.g.cs @@ -74,6 +74,33 @@ partial void ProcessProjectsListProjectsResponseContent( string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ProjectsListProjectsAsResponseAsync( + name: name, + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Projects (Cloud-only)
+ /// List all projects + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ProjectsListProjectsAsResponseAsync( + string? name = default, + global::Letta.OneOf? offset = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,15 +132,16 @@ partial void ProcessProjectsListProjectsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/projects", baseUri: ResolveBaseUri( servers: s_ProjectsListProjectsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("name", name) .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit) + .AddOptionalParameter("limit", limit) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -187,6 +215,8 @@ partial void ProcessProjectsListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +227,11 @@ partial void ProcessProjectsListProjectsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +249,8 @@ partial void ProcessProjectsListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +260,7 @@ partial void ProcessProjectsListProjectsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +269,11 @@ partial void ProcessProjectsListProjectsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +290,15 @@ partial void ProcessProjectsListProjectsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +338,8 @@ partial void ProcessProjectsListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +360,8 @@ partial void ProcessProjectsListProjectsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -340,9 +386,13 @@ partial void ProcessProjectsListProjectsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ProjectsListProjectsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ProjectsListProjectsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -370,9 +420,13 @@ partial void ProcessProjectsListProjectsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ProjectsListProjectsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ProjectsListProjectsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProjectsClient.g.cs b/src/libs/Letta/Generated/Letta.ProjectsClient.g.cs index aeb85f19..aa011104 100644 --- a/src/libs/Letta/Generated/Letta.ProjectsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ProjectsClient.g.cs @@ -103,10 +103,10 @@ public ProjectsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProjectsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.CheckExistingProvider.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.CheckExistingProvider.g.cs index c8c022d1..2c81e259 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.CheckExistingProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.CheckExistingProvider.g.cs @@ -68,6 +68,29 @@ partial void ProcessCheckExistingProviderResponseContent( string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CheckExistingProviderAsResponseAsync( + providerId: providerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Check Existing Provider
+ /// Verify the API key and additional parameters for an existing provider. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CheckExistingProviderAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessCheckExistingProviderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/providers/{providerId}/check", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessCheckExistingProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessCheckExistingProviderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessCheckExistingProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessCheckExistingProviderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessCheckExistingProviderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessCheckExistingProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessCheckExistingProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessCheckExistingProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,7 +405,11 @@ partial void ProcessCheckExistingProviderResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -391,7 +437,11 @@ partial void ProcessCheckExistingProviderResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.CheckProvider.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.CheckProvider.g.cs index c1462983..733f2c66 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.CheckProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.CheckProvider.g.cs @@ -64,6 +64,29 @@ partial void ProcessCheckProviderResponseContent( /// public async global::System.Threading.Tasks.Task CheckProviderAsync( + global::Letta.ProviderCheck request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CheckProviderAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Check Provider
+ /// Verify the API key and additional parameters for a provider. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CheckProviderAsResponseAsync( + global::Letta.ProviderCheck request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCheckProviderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/providers/check", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCheckProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCheckProviderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCheckProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCheckProviderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCheckProviderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCheckProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCheckProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCheckProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,7 +412,11 @@ partial void ProcessCheckProviderResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -398,7 +444,11 @@ partial void ProcessCheckProviderResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.CreateProvider.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.CreateProvider.g.cs index 9cf9f82a..579a12d4 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.CreateProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.CreateProvider.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateProviderResponseContent( /// public async global::System.Threading.Tasks.Task CreateProviderAsync( + global::Letta.ProviderCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateProviderAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Provider
+ /// Create a new custom provider. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateProviderAsResponseAsync( + global::Letta.ProviderCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateProviderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/providers/", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateProviderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateProviderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateProviderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessCreateProviderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateProviderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.DeleteProvider.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.DeleteProvider.g.cs index 334282be..db83323f 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.DeleteProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.DeleteProvider.g.cs @@ -68,6 +68,29 @@ partial void ProcessDeleteProviderResponseContent( string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteProviderAsResponseAsync( + providerId: providerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Provider
+ /// Delete an existing custom provider. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteProviderAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessDeleteProviderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/providers/{providerId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessDeleteProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessDeleteProviderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessDeleteProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessDeleteProviderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessDeleteProviderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessDeleteProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessDeleteProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessDeleteProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,7 +405,11 @@ partial void ProcessDeleteProviderResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -391,7 +437,11 @@ partial void ProcessDeleteProviderResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.ListProviders.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.ListProviders.g.cs index 8bdb9e3c..8cf7b74e 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.ListProviders.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.ListProviders.g.cs @@ -107,6 +107,62 @@ partial void ProcessListProvidersResponseContent( global::Letta.ProviderType? providerType = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListProvidersAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + name: name, + providerType: providerType, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Providers
+ /// Get a list of all custom providers. + ///
+ /// + /// Provider ID cursor for pagination. Returns providers that come before this provider ID in the specified sort order + /// + /// + /// Provider ID cursor for pagination. Returns providers that come after this provider ID in the specified sort order + /// + /// + /// Maximum number of providers to return
+ /// Default Value: 50 + /// + /// + /// Sort order for providers by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter providers by name + /// + /// + /// Filter providers by type + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListProvidersAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListProvidersOrder? order = default, + string? orderBy = default, + string? name = default, + global::Letta.ProviderType? providerType = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -142,11 +198,12 @@ partial void ProcessListProvidersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/providers/", baseUri: ResolveBaseUri( servers: s_ListProvidersServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -154,7 +211,7 @@ partial void ProcessListProvidersResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("name", name) - .AddOptionalParameter("provider_type", providerType?.ToString()) + .AddOptionalParameter("provider_type", providerType?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -232,6 +289,8 @@ partial void ProcessListProvidersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -242,6 +301,11 @@ partial void ProcessListProvidersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -259,6 +323,8 @@ partial void ProcessListProvidersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -268,8 +334,7 @@ partial void ProcessListProvidersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -278,6 +343,11 @@ partial void ProcessListProvidersResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -294,14 +364,15 @@ partial void ProcessListProvidersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -341,6 +412,8 @@ partial void ProcessListProvidersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -361,6 +434,8 @@ partial void ProcessListProvidersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -423,9 +498,13 @@ partial void ProcessListProvidersResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -453,9 +532,13 @@ partial void ProcessListProvidersResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.ModifyProvider.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.ModifyProvider.g.cs index 1c1b1869..c8a1ebd6 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.ModifyProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.ModifyProvider.g.cs @@ -70,6 +70,34 @@ partial void ProcessModifyProviderResponseContent( public async global::System.Threading.Tasks.Task ModifyProviderAsync( string providerId, + global::Letta.ProviderUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyProviderAsResponseAsync( + providerId: providerId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Provider
+ /// Update an existing custom provider. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyProviderAsResponseAsync( + string providerId, + global::Letta.ProviderUpdate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessModifyProviderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/providers/{providerId}", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessModifyProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessModifyProviderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessModifyProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessModifyProviderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessModifyProviderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessModifyProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessModifyProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessModifyProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessModifyProviderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessModifyProviderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.RefreshProviderModels.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.RefreshProviderModels.g.cs index f16150ab..e7a79a41 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.RefreshProviderModels.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.RefreshProviderModels.g.cs @@ -69,6 +69,30 @@ partial void ProcessRefreshProviderModelsResponseContent( string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RefreshProviderModelsAsResponseAsync( + providerId: providerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Refresh Provider Models
+ /// Refresh models for a BYOK provider by querying the provider's API.
+ /// Adds new models and removes ones no longer available. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RefreshProviderModelsAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -98,6 +122,7 @@ partial void ProcessRefreshProviderModelsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/providers/{providerId}/refresh", baseUri: ResolveBaseUri( @@ -173,6 +198,8 @@ partial void ProcessRefreshProviderModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +210,11 @@ partial void ProcessRefreshProviderModelsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -200,6 +232,8 @@ partial void ProcessRefreshProviderModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +243,7 @@ partial void ProcessRefreshProviderModelsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +252,11 @@ partial void ProcessRefreshProviderModelsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -235,14 +273,15 @@ partial void ProcessRefreshProviderModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +321,8 @@ partial void ProcessRefreshProviderModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +343,8 @@ partial void ProcessRefreshProviderModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -364,9 +407,13 @@ partial void ProcessRefreshProviderModelsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -394,9 +441,13 @@ partial void ProcessRefreshProviderModelsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.RetrieveProvider.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.RetrieveProvider.g.cs index 35da386f..9f8b9921 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.RetrieveProvider.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.RetrieveProvider.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveProviderResponseContent( string providerId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveProviderAsResponseAsync( + providerId: providerId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Provider
+ /// Get a provider by ID. + ///
+ /// + /// The ID of the provider in the format 'provider-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveProviderAsResponseAsync( + string providerId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveProviderResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/providers/{providerId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveProviderResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveProviderResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveProviderResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveProviderResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveProviderResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveProviderResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Provider.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveProviderResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Provider.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ProvidersClient.g.cs b/src/libs/Letta/Generated/Letta.ProvidersClient.g.cs index 417cd4bd..1231d5b1 100644 --- a/src/libs/Letta/Generated/Letta.ProvidersClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ProvidersClient.g.cs @@ -103,10 +103,10 @@ public ProvidersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ProvidersClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.DeleteRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.DeleteRun.g.cs index c7fa50cc..ea3d884b 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.DeleteRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.DeleteRun.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteRunResponseContent( string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteRunAsResponseAsync( + runId: runId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Run
+ /// Delete a run by its run_id. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,7 +401,11 @@ partial void ProcessDeleteRunResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -389,7 +433,11 @@ partial void ProcessDeleteRunResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.ListMessagesForRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.ListMessagesForRun.g.cs index 7f474b61..eaf5a4c6 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.ListMessagesForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.ListMessagesForRun.g.cs @@ -99,6 +99,55 @@ partial void ProcessListMessagesForRunResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMessagesForRunAsResponseAsync( + runId: runId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Messages For Run
+ /// Get response messages associated with a run. + ///
+ /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListMessagesForRunAsResponseAsync( + string runId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesForRunOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -133,17 +182,18 @@ partial void ProcessListMessagesForRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}/messages", baseUri: ResolveBaseUri( servers: s_ListMessagesForRunServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -220,6 +270,8 @@ partial void ProcessListMessagesForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +282,11 @@ partial void ProcessListMessagesForRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -247,6 +304,8 @@ partial void ProcessListMessagesForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -256,8 +315,7 @@ partial void ProcessListMessagesForRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -266,6 +324,11 @@ partial void ProcessListMessagesForRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -282,14 +345,15 @@ partial void ProcessListMessagesForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -329,6 +393,8 @@ partial void ProcessListMessagesForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +415,8 @@ partial void ProcessListMessagesForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -411,9 +479,13 @@ partial void ProcessListMessagesForRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -441,9 +513,13 @@ partial void ProcessListMessagesForRunResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.ListRuns.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.ListRuns.g.cs index 1459124c..7dc04ba5 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.ListRuns.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.ListRuns.g.cs @@ -147,6 +147,94 @@ partial void ProcessListRunsResponseContent( bool? ascending = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListRunsAsResponseAsync( + agentId: agentId, + agentIds: agentIds, + statuses: statuses, + background: background, + stopReason: stopReason, + conversationId: conversationId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + active: active, + ascending: ascending, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Runs
+ /// List all runs. + ///
+ /// + /// The unique identifier of the agent associated with the run. + /// + /// + /// The unique identifiers of the agents associated with the run. Deprecated in favor of agent_id field. + /// + /// + /// Filter runs by status. Can specify multiple statuses. + /// + /// + /// If True, filters for runs that were created in background mode. + /// + /// + /// Filter runs by stop reason. + /// + /// + /// Filter runs by conversation ID. + /// + /// + /// Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order + /// + /// + /// Run ID cursor for pagination. Returns runs that come after this run ID in the specified sort order + /// + /// + /// Maximum number of runs to return
+ /// Default Value: 100 + /// + /// + /// Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter for active runs.
+ /// Default Value: false + /// + /// + /// Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field.
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListRunsAsResponseAsync( + string? agentId = default, + global::System.Collections.Generic.IList? agentIds = default, + global::System.Collections.Generic.IList? statuses = default, + bool? background = default, + global::Letta.StopReasonType? stopReason = default, + string? conversationId = default, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListRunsOrder? order = default, + string? orderBy = default, + bool? active = default, + bool? ascending = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -188,11 +276,12 @@ partial void ProcessListRunsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/runs/", baseUri: ResolveBaseUri( servers: s_ListRunsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("agent_id", agentId) .AddOptionalParameter("agent_ids", agentIds?.ToString()) @@ -206,7 +295,7 @@ partial void ProcessListRunsResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("active", active?.ToString().ToLowerInvariant()) - .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) + .AddOptionalParameter("ascending", ascending?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -290,6 +379,8 @@ partial void ProcessListRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -300,6 +391,11 @@ partial void ProcessListRunsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -317,6 +413,8 @@ partial void ProcessListRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -326,8 +424,7 @@ partial void ProcessListRunsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -336,6 +433,11 @@ partial void ProcessListRunsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -352,14 +454,15 @@ partial void ProcessListRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -399,6 +502,8 @@ partial void ProcessListRunsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -419,6 +524,8 @@ partial void ProcessListRunsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -481,9 +588,13 @@ partial void ProcessListRunsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -511,9 +622,13 @@ partial void ProcessListRunsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.ListStepsForRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.ListStepsForRun.g.cs index f1413d0e..0bc98e94 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.ListStepsForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.ListStepsForRun.g.cs @@ -99,6 +99,55 @@ partial void ProcessListStepsForRunResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStepsForRunAsResponseAsync( + runId: runId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Steps For Run
+ /// Get steps associated with a run with filtering options. + ///
+ /// + /// + /// Cursor for pagination + /// + /// + /// Cursor for pagination + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for steps by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListStepsForRunAsResponseAsync( + string runId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListStepsForRunOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -133,17 +182,18 @@ partial void ProcessListStepsForRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}/steps", baseUri: ResolveBaseUri( servers: s_ListStepsForRunServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -220,6 +270,8 @@ partial void ProcessListStepsForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +282,11 @@ partial void ProcessListStepsForRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -247,6 +304,8 @@ partial void ProcessListStepsForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -256,8 +315,7 @@ partial void ProcessListStepsForRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -266,6 +324,11 @@ partial void ProcessListStepsForRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -282,14 +345,15 @@ partial void ProcessListStepsForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -329,6 +393,8 @@ partial void ProcessListStepsForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +415,8 @@ partial void ProcessListStepsForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -411,9 +479,13 @@ partial void ProcessListStepsForRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -441,9 +513,13 @@ partial void ProcessListStepsForRunResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveMetricsForRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveMetricsForRun.g.cs index 7c7684ec..2aeed031 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveMetricsForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveMetricsForRun.g.cs @@ -66,6 +66,27 @@ partial void ProcessRetrieveMetricsForRunResponseContent( string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveMetricsForRunAsResponseAsync( + runId: runId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Metrics For Run
+ /// Get run metrics by run ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveMetricsForRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessRetrieveMetricsForRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}/metrics", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessRetrieveMetricsForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessRetrieveMetricsForRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessRetrieveMetricsForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessRetrieveMetricsForRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessRetrieveMetricsForRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessRetrieveMetricsForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessRetrieveMetricsForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessRetrieveMetricsForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessRetrieveMetricsForRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.RunMetrics.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.RunMetrics.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessRetrieveMetricsForRunResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.RunMetrics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.RunMetrics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveRun.g.cs index a44f3dd6..bf03a0a6 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveRun.g.cs @@ -66,6 +66,27 @@ partial void ProcessRetrieveRunResponseContent( string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveRunAsResponseAsync( + runId: runId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Run
+ /// Get the status of a run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessRetrieveRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessRetrieveRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessRetrieveRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessRetrieveRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessRetrieveRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessRetrieveRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessRetrieveRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessRetrieveRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessRetrieveRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessRetrieveRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Run.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Run.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessRetrieveRunResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Run.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveStreamForRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveStreamForRun.g.cs index 632c5fe7..b16458bc 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveStreamForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveStreamForRun.g.cs @@ -67,6 +67,31 @@ partial void ProcessRetrieveStreamForRunResponseContent( public async global::System.Threading.Tasks.Task RetrieveStreamForRunAsync( string runId, + global::Letta.RetrieveStreamRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveStreamForRunAsResponseAsync( + runId: runId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Stream For Run + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveStreamForRunAsResponseAsync( + string runId, + global::Letta.RetrieveStreamRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -102,6 +127,7 @@ partial void ProcessRetrieveStreamForRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}/stream", baseUri: ResolveBaseUri( @@ -184,6 +210,8 @@ partial void ProcessRetrieveStreamForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +222,11 @@ partial void ProcessRetrieveStreamForRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +244,8 @@ partial void ProcessRetrieveStreamForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +255,7 @@ partial void ProcessRetrieveStreamForRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +264,11 @@ partial void ProcessRetrieveStreamForRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +285,15 @@ partial void ProcessRetrieveStreamForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +333,8 @@ partial void ProcessRetrieveStreamForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +355,8 @@ partial void ProcessRetrieveStreamForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -375,7 +419,11 @@ partial void ProcessRetrieveStreamForRunResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -403,7 +451,11 @@ partial void ProcessRetrieveStreamForRunResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveTraceForRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveTraceForRun.g.cs index 9f41f053..7b061525 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveTraceForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveTraceForRun.g.cs @@ -79,6 +79,39 @@ partial void ProcessRetrieveTraceForRunResponseContent( int? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveTraceForRunAsResponseAsync( + runId: runId, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Trace For Run
+ /// Retrieve OTEL trace spans for a run.
+ /// Returns a filtered set of spans relevant for observability:
+ /// - agent_step: Individual agent reasoning steps
+ /// - tool executions: Tool call spans
+ /// - Root span: The top-level request span
+ /// - time_to_first_token: TTFT measurement span
+ /// Requires ClickHouse to be configured for trace storage. + ///
+ /// + /// + /// Maximum number of spans to return
+ /// Default Value: 1000 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> RetrieveTraceForRunAsResponseAsync( + string runId, + int? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,13 +142,14 @@ partial void ProcessRetrieveTraceForRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}/trace", baseUri: ResolveBaseUri( servers: s_RetrieveTraceForRunServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -188,6 +222,8 @@ partial void ProcessRetrieveTraceForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -198,6 +234,11 @@ partial void ProcessRetrieveTraceForRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -215,6 +256,8 @@ partial void ProcessRetrieveTraceForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -224,8 +267,7 @@ partial void ProcessRetrieveTraceForRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -234,6 +276,11 @@ partial void ProcessRetrieveTraceForRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -250,14 +297,15 @@ partial void ProcessRetrieveTraceForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -297,6 +345,8 @@ partial void ProcessRetrieveTraceForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -317,6 +367,8 @@ partial void ProcessRetrieveTraceForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -379,9 +431,13 @@ partial void ProcessRetrieveTraceForRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -409,9 +465,13 @@ partial void ProcessRetrieveTraceForRunResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveUsageForRun.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveUsageForRun.g.cs index dd5b5092..356137f9 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.RetrieveUsageForRun.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.RetrieveUsageForRun.g.cs @@ -66,6 +66,27 @@ partial void ProcessRetrieveUsageForRunResponseContent( string runId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveUsageForRunAsResponseAsync( + runId: runId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Usage For Run
+ /// Get usage statistics for a run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveUsageForRunAsResponseAsync( + string runId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessRetrieveUsageForRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/runs/{runId}/usage", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessRetrieveUsageForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessRetrieveUsageForRunResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessRetrieveUsageForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessRetrieveUsageForRunResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessRetrieveUsageForRunResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessRetrieveUsageForRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessRetrieveUsageForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessRetrieveUsageForRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessRetrieveUsageForRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.UsageStatistics.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.UsageStatistics.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessRetrieveUsageForRunResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.UsageStatistics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.UsageStatistics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.RunsClient.g.cs b/src/libs/Letta/Generated/Letta.RunsClient.g.cs index 4b29077d..4a4722d1 100644 --- a/src/libs/Letta/Generated/Letta.RunsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.RunsClient.g.cs @@ -103,10 +103,10 @@ public RunsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public RunsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesCreateSandbox.g.cs b/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesCreateSandbox.g.cs index 673ce46e..cfae9a74 100644 --- a/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesCreateSandbox.g.cs +++ b/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesCreateSandbox.g.cs @@ -64,6 +64,29 @@ partial void ProcessSandboxesCreateSandboxResponseContent( /// public async global::System.Threading.Tasks.Task SandboxesCreateSandboxAsync( + global::Letta.SandboxesCreateSandboxRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SandboxesCreateSandboxAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Sandbox
+ /// Create a new Modal Sandbox that runs letta remote automatically + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SandboxesCreateSandboxAsResponseAsync( + global::Letta.SandboxesCreateSandboxRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessSandboxesCreateSandboxResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/sandboxes", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessSandboxesCreateSandboxResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessSandboxesCreateSandboxResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessSandboxesCreateSandboxResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessSandboxesCreateSandboxResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessSandboxesCreateSandboxResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessSandboxesCreateSandboxResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessSandboxesCreateSandboxResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessSandboxesCreateSandboxResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -408,9 +450,13 @@ partial void ProcessSandboxesCreateSandboxResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.SandboxesCreateSandboxResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.SandboxesCreateSandboxResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -438,9 +484,13 @@ partial void ProcessSandboxesCreateSandboxResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.SandboxesCreateSandboxResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.SandboxesCreateSandboxResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesListSandboxes.g.cs b/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesListSandboxes.g.cs index f58299ff..2d31eb64 100644 --- a/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesListSandboxes.g.cs +++ b/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesListSandboxes.g.cs @@ -70,6 +70,30 @@ partial void ProcessSandboxesListSandboxesResponseContent( string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SandboxesListSandboxesAsResponseAsync( + agentId: agentId, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Sandboxes
+ /// List all sandboxes for the organization + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SandboxesListSandboxesAsResponseAsync( + string? agentId = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,14 +124,15 @@ partial void ProcessSandboxesListSandboxesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/sandboxes", baseUri: ResolveBaseUri( servers: s_SandboxesListSandboxesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("agentId", agentId) - .AddOptionalParameter("limit", limit) + .AddOptionalParameter("limit", limit) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -180,6 +205,8 @@ partial void ProcessSandboxesListSandboxesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -190,6 +217,11 @@ partial void ProcessSandboxesListSandboxesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -207,6 +239,8 @@ partial void ProcessSandboxesListSandboxesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -216,8 +250,7 @@ partial void ProcessSandboxesListSandboxesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -226,6 +259,11 @@ partial void ProcessSandboxesListSandboxesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -242,14 +280,15 @@ partial void ProcessSandboxesListSandboxesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -289,6 +328,8 @@ partial void ProcessSandboxesListSandboxesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -309,6 +350,8 @@ partial void ProcessSandboxesListSandboxesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -333,9 +376,13 @@ partial void ProcessSandboxesListSandboxesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.SandboxesListSandboxesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.SandboxesListSandboxesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -363,9 +410,13 @@ partial void ProcessSandboxesListSandboxesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.SandboxesListSandboxesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.SandboxesListSandboxesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesTerminateSandbox.g.cs b/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesTerminateSandbox.g.cs index 88991fdb..9d3bb82e 100644 --- a/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesTerminateSandbox.g.cs +++ b/src/libs/Letta/Generated/Letta.SandboxesClient.SandboxesTerminateSandbox.g.cs @@ -68,6 +68,32 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( public async global::System.Threading.Tasks.Task SandboxesTerminateSandboxAsync( string sandboxId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SandboxesTerminateSandboxAsResponseAsync( + sandboxId: sandboxId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Terminate Sandbox
+ /// Terminate a Modal Sandbox + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SandboxesTerminateSandboxAsResponseAsync( + string sandboxId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/sandboxes/{sandboxId}/terminate", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -414,9 +459,13 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.SandboxesTerminateSandboxResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.SandboxesTerminateSandboxResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +493,13 @@ partial void ProcessSandboxesTerminateSandboxResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.SandboxesTerminateSandboxResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.SandboxesTerminateSandboxResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.SandboxesClient.g.cs b/src/libs/Letta/Generated/Letta.SandboxesClient.g.cs index 3c40f9cc..838ade3b 100644 --- a/src/libs/Letta/Generated/Letta.SandboxesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.SandboxesClient.g.cs @@ -103,10 +103,10 @@ public SandboxesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public SandboxesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs index 9f15f5b3..b5d9add0 100644 --- a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesDeleteScheduledMessage.g.cs @@ -72,6 +72,35 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( string agentId, string scheduledMessageId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ScheduledMessagesDeleteScheduledMessageAsResponseAsync( + agentId: agentId, + scheduledMessageId: scheduledMessageId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Scheduled Agent Message
+ /// Delete a scheduled message by its ID for a specific agent. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ScheduledMessagesDeleteScheduledMessageAsResponseAsync( + string agentId, + string scheduledMessageId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/schedule/{scheduledMessageId}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -344,9 +392,13 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ScheduledMessagesDeleteScheduledMessageResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ScheduledMessagesDeleteScheduledMessageResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -374,9 +426,13 @@ partial void ProcessScheduledMessagesDeleteScheduledMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ScheduledMessagesDeleteScheduledMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ScheduledMessagesDeleteScheduledMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs index b9b98c93..44e93b49 100644 --- a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs +++ b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesListScheduledMessages.g.cs @@ -74,6 +74,33 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( string? after = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ScheduledMessagesListScheduledMessagesAsResponseAsync( + agentId: agentId, + limit: limit, + after: after, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Scheduled Agent Messages
+ /// List all scheduled messages for a specific agent. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ScheduledMessagesListScheduledMessagesAsResponseAsync( + string agentId, + string? limit = default, + string? after = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,14 +132,15 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/schedule", baseUri: ResolveBaseUri( servers: s_ScheduledMessagesListScheduledMessagesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("limit", limit) - .AddOptionalParameter("after", after) + .AddOptionalParameter("after", after) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -186,6 +214,8 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -339,9 +385,13 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ScheduledMessagesListScheduledMessagesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ScheduledMessagesListScheduledMessagesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -369,9 +419,13 @@ partial void ProcessScheduledMessagesListScheduledMessagesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ScheduledMessagesListScheduledMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ScheduledMessagesListScheduledMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs index 87dc380a..188a260a 100644 --- a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesRetrieveScheduledMessage.g.cs @@ -70,6 +70,30 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( string scheduledMessageId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ScheduledMessagesRetrieveScheduledMessageAsResponseAsync( + agentId: agentId, + scheduledMessageId: scheduledMessageId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Scheduled Agent Message
+ /// Retrieve a scheduled message by its ID for a specific agent. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ScheduledMessagesRetrieveScheduledMessageAsResponseAsync( + string agentId, + string scheduledMessageId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/schedule/{scheduledMessageId}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ScheduledMessagesRetrieveScheduledMessageResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ScheduledMessagesRetrieveScheduledMessageResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessScheduledMessagesRetrieveScheduledMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ScheduledMessagesRetrieveScheduledMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ScheduledMessagesRetrieveScheduledMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs index 5c81a193..a5c9b1da 100644 --- a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs +++ b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.ScheduledMessagesScheduleAgentMessage.g.cs @@ -68,6 +68,32 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( public async global::System.Threading.Tasks.Task ScheduledMessagesScheduleAgentMessageAsync( string agentId, + global::Letta.ScheduledMessagesScheduleAgentMessageRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ScheduledMessagesScheduleAgentMessageAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Schedule Agent Message
+ /// Schedule a message to be sent by the agent at a specified time or on a recurring basis. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ScheduledMessagesScheduleAgentMessageAsResponseAsync( + string agentId, + global::Letta.ScheduledMessagesScheduleAgentMessageRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/agents/{agentId}/schedule", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -338,9 +383,13 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ScheduledMessagesScheduleAgentMessageResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ScheduledMessagesScheduleAgentMessageResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -368,9 +417,13 @@ partial void ProcessScheduledMessagesScheduleAgentMessageResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ScheduledMessagesScheduleAgentMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ScheduledMessagesScheduleAgentMessageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.g.cs b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.g.cs index 0a427377..74583281 100644 --- a/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ScheduledMessagesClient.g.cs @@ -103,10 +103,10 @@ public ScheduledMessagesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ScheduledMessagesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.ListMessagesForStep.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.ListMessagesForStep.g.cs index 69e9ed98..50269252 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.ListMessagesForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.ListMessagesForStep.g.cs @@ -101,6 +101,57 @@ partial void ProcessListMessagesForStepResponseContent( string? orderBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMessagesForStepAsResponseAsync( + stepId: stepId, + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Messages For Step
+ /// List messages for a given step. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// + /// Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order + /// + /// + /// Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order + /// + /// + /// Maximum number of messages to return
+ /// Default Value: 100 + /// + /// + /// Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: asc + /// + /// + /// Sort by field
+ /// Default Value: created_at + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListMessagesForStepAsResponseAsync( + string stepId, + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListMessagesForStepOrder? order = default, + string? orderBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -135,17 +186,18 @@ partial void ProcessListMessagesForStepResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/steps/{stepId}/messages", baseUri: ResolveBaseUri( servers: s_ListMessagesForStepServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) .AddOptionalParameter("limit", limit?.ToString()) .AddOptionalParameter("order", order?.ToValueString()) - .AddOptionalParameter("order_by", orderBy) + .AddOptionalParameter("order_by", orderBy) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -222,6 +274,8 @@ partial void ProcessListMessagesForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -232,6 +286,11 @@ partial void ProcessListMessagesForStepResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -249,6 +308,8 @@ partial void ProcessListMessagesForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -258,8 +319,7 @@ partial void ProcessListMessagesForStepResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -268,6 +328,11 @@ partial void ProcessListMessagesForStepResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -284,14 +349,15 @@ partial void ProcessListMessagesForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -331,6 +397,8 @@ partial void ProcessListMessagesForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -351,6 +419,8 @@ partial void ProcessListMessagesForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -413,9 +483,13 @@ partial void ProcessListMessagesForStepResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -443,9 +517,13 @@ partial void ProcessListMessagesForStepResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.ListSteps.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.ListSteps.g.cs index ca57fac1..606acaa4 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.ListSteps.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.ListSteps.g.cs @@ -155,6 +155,102 @@ partial void ProcessListStepsResponseContent( string? xProject = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListStepsAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + startDate: startDate, + endDate: endDate, + model: model, + agentId: agentId, + traceIds: traceIds, + feedback: feedback, + hasFeedback: hasFeedback, + tags: tags, + projectId: projectId, + xProject: xProject, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Steps
+ /// List steps with optional pagination and date filters. + ///
+ /// + /// Return steps before this step ID + /// + /// + /// Return steps after this step ID + /// + /// + /// Maximum number of steps to return
+ /// Default Value: 50 + /// + /// + /// Sort order for steps by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Return steps after this ISO datetime (e.g. "2025-01-29T15:01:19-08:00") + /// + /// + /// Return steps before this ISO datetime (e.g. "2025-01-29T15:01:19-08:00") + /// + /// + /// Filter by the name of the model used for the step + /// + /// + /// Filter by the ID of the agent that performed the step + /// + /// + /// Filter by trace ids returned by the server + /// + /// + /// Filter by feedback + /// + /// + /// Filter by whether steps have feedback (true) or not (false) + /// + /// + /// Filter by tags + /// + /// + /// Filter by the project ID that is associated with the step (cloud only). + /// + /// + /// Filter by project slug to associate with the group (cloud only). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListStepsAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListStepsOrder? order = default, + string? orderBy = default, + string? startDate = default, + string? endDate = default, + string? model = default, + string? agentId = default, + global::System.Collections.Generic.IList? traceIds = default, + global::Letta.ListStepsFeedback2? feedback = default, + bool? hasFeedback = default, + global::System.Collections.Generic.IList? tags = default, + string? projectId = default, + string? xProject = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -198,11 +294,12 @@ partial void ProcessListStepsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/steps/", baseUri: ResolveBaseUri( servers: s_ListStepsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -217,7 +314,7 @@ partial void ProcessListStepsResponseContent( .AddOptionalParameter("feedback", feedback?.ToString()) .AddOptionalParameter("has_feedback", hasFeedback?.ToString().ToLowerInvariant()) .AddOptionalParameter("tags", tags?.ToString()) - .AddOptionalParameter("project_id", projectId) + .AddOptionalParameter("project_id", projectId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -309,6 +406,8 @@ partial void ProcessListStepsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -319,6 +418,11 @@ partial void ProcessListStepsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -336,6 +440,8 @@ partial void ProcessListStepsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -345,8 +451,7 @@ partial void ProcessListStepsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -355,6 +460,11 @@ partial void ProcessListStepsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -371,14 +481,15 @@ partial void ProcessListStepsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -418,6 +529,8 @@ partial void ProcessListStepsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -438,6 +551,8 @@ partial void ProcessListStepsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -500,9 +615,13 @@ partial void ProcessListStepsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -530,9 +649,13 @@ partial void ProcessListStepsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.ModifyFeedbackForStep.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.ModifyFeedbackForStep.g.cs index e4d826e5..02f698ab 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.ModifyFeedbackForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.ModifyFeedbackForStep.g.cs @@ -70,6 +70,34 @@ partial void ProcessModifyFeedbackForStepResponseContent( public async global::System.Threading.Tasks.Task ModifyFeedbackForStepAsync( string stepId, + global::Letta.ModifyFeedbackRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyFeedbackForStepAsResponseAsync( + stepId: stepId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Feedback For Step
+ /// Modify feedback for a given step. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyFeedbackForStepAsResponseAsync( + string stepId, + global::Letta.ModifyFeedbackRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessModifyFeedbackForStepResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/steps/{stepId}/feedback", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessModifyFeedbackForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessModifyFeedbackForStepResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessModifyFeedbackForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessModifyFeedbackForStepResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessModifyFeedbackForStepResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessModifyFeedbackForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessModifyFeedbackForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessModifyFeedbackForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessModifyFeedbackForStepResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Step.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Step.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessModifyFeedbackForStepResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Step.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Step.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.RetrieveMetricsForStep.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.RetrieveMetricsForStep.g.cs index c0345d9f..5b9cc760 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.RetrieveMetricsForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.RetrieveMetricsForStep.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveMetricsForStepResponseContent( string stepId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveMetricsForStepAsResponseAsync( + stepId: stepId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Metrics For Step
+ /// Get step metrics by step ID. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveMetricsForStepAsResponseAsync( + string stepId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveMetricsForStepResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/steps/{stepId}/metrics", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveMetricsForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveMetricsForStepResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveMetricsForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveMetricsForStepResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveMetricsForStepResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveMetricsForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveMetricsForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveMetricsForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveMetricsForStepResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.StepMetrics.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.StepMetrics.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveMetricsForStepResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.StepMetrics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.StepMetrics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.RetrieveStep.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.RetrieveStep.g.cs index 014a4465..fcf3bbf5 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.RetrieveStep.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.RetrieveStep.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveStepResponseContent( string stepId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveStepAsResponseAsync( + stepId: stepId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Step
+ /// Get a step by ID. + ///
+ /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveStepAsResponseAsync( + string stepId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveStepResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/steps/{stepId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveStepResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveStepResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveStepResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveStepResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Step.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Step.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveStepResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Step.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Step.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.RetrieveTraceForStep.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.RetrieveTraceForStep.g.cs index 8e16576f..c3a4f1cf 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.RetrieveTraceForStep.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.RetrieveTraceForStep.g.cs @@ -67,6 +67,28 @@ partial void ProcessRetrieveTraceForStepResponseContent( string stepId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveTraceForStepAsResponseAsync( + stepId: stepId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Trace For Step + /// + /// + /// The ID of the step in the format 'step-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveTraceForStepAsResponseAsync( + string stepId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -96,6 +118,7 @@ partial void ProcessRetrieveTraceForStepResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/steps/{stepId}/trace", baseUri: ResolveBaseUri( @@ -171,6 +194,8 @@ partial void ProcessRetrieveTraceForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +206,11 @@ partial void ProcessRetrieveTraceForStepResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -198,6 +228,8 @@ partial void ProcessRetrieveTraceForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +239,7 @@ partial void ProcessRetrieveTraceForStepResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +248,11 @@ partial void ProcessRetrieveTraceForStepResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -233,14 +269,15 @@ partial void ProcessRetrieveTraceForStepResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +317,8 @@ partial void ProcessRetrieveTraceForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +339,8 @@ partial void ProcessRetrieveTraceForStepResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,9 +403,13 @@ partial void ProcessRetrieveTraceForStepResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ProviderTrace.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ProviderTrace.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -392,9 +437,13 @@ partial void ProcessRetrieveTraceForStepResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ProviderTrace.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ProviderTrace.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.StepsClient.g.cs b/src/libs/Letta/Generated/Letta.StepsClient.g.cs index b9f1db4f..31f16aa2 100644 --- a/src/libs/Letta/Generated/Letta.StepsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.StepsClient.g.cs @@ -103,10 +103,10 @@ public StepsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public StepsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.TagClient.ListTags.g.cs b/src/libs/Letta/Generated/Letta.TagClient.ListTags.g.cs index bd235107..c982bef1 100644 --- a/src/libs/Letta/Generated/Letta.TagClient.ListTags.g.cs +++ b/src/libs/Letta/Generated/Letta.TagClient.ListTags.g.cs @@ -109,6 +109,62 @@ partial void ProcessListTagsResponseContent( string? name = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListTagsAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + queryText: queryText, + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Tags
+ /// Get the list of all tags (from agents and blocks) that have been created. + ///
+ /// + /// Tag cursor for pagination. Returns tags that come before this tag in the specified sort order + /// + /// + /// Tag cursor for pagination. Returns tags that come after this tag in the specified sort order + /// + /// + /// Maximum number of tags to return
+ /// Default Value: 50 + /// + /// + /// Sort order for tags. 'asc' for alphabetical order, 'desc' for reverse alphabetical order
+ /// Default Value: asc + /// + /// + /// Field to sort by
+ /// Default Value: name + /// + /// + /// Filter tags by text search. Deprecated, please use name field instead + /// + /// + /// Filter tags by name + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListTagsAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListTagsOrder? order = default, + string? orderBy = default, + string? queryText = default, + string? name = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -144,11 +200,12 @@ partial void ProcessListTagsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tags/", baseUri: ResolveBaseUri( servers: s_ListTagsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -156,7 +213,7 @@ partial void ProcessListTagsResponseContent( .AddOptionalParameter("order", order?.ToValueString()) .AddOptionalParameter("order_by", orderBy) .AddOptionalParameter("query_text", queryText) - .AddOptionalParameter("name", name) + .AddOptionalParameter("name", name) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -234,6 +291,8 @@ partial void ProcessListTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -244,6 +303,11 @@ partial void ProcessListTagsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -261,6 +325,8 @@ partial void ProcessListTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -270,8 +336,7 @@ partial void ProcessListTagsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -280,6 +345,11 @@ partial void ProcessListTagsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -296,14 +366,15 @@ partial void ProcessListTagsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -343,6 +414,8 @@ partial void ProcessListTagsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -363,6 +436,8 @@ partial void ProcessListTagsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -425,9 +500,13 @@ partial void ProcessListTagsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -455,9 +534,13 @@ partial void ProcessListTagsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TagClient.g.cs b/src/libs/Letta/Generated/Letta.TagClient.g.cs index 8c2496a5..d78819c3 100644 --- a/src/libs/Letta/Generated/Letta.TagClient.g.cs +++ b/src/libs/Letta/Generated/Letta.TagClient.g.cs @@ -103,10 +103,10 @@ public TagClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public TagClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs index bd3c02a4..10ba5265 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplate.g.cs @@ -67,6 +67,33 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( string projectId, string templateVersion, + global::Letta.TemplatesCreateAgentsFromTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await TemplatesCreateAgentsFromTemplateAsResponseAsync( + projectId: projectId, + templateVersion: templateVersion, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Create Agents From Template
+ /// Creates an Agent or multiple Agents from a template + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TemplatesCreateAgentsFromTemplateAsResponseAsync( + string projectId, + string templateVersion, + global::Letta.TemplatesCreateAgentsFromTemplateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +130,7 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateVersion}/agents", baseUri: ResolveBaseUri( @@ -186,6 +214,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -196,6 +226,11 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -213,6 +248,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -222,8 +259,7 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -232,6 +268,11 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -248,14 +289,15 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -295,6 +337,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -315,6 +359,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 402 @@ -373,6 +419,10 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { @@ -394,6 +444,10 @@ partial void ProcessTemplatesCreateAgentsFromTemplateResponse( try { __response.EnsureSuccessStatusCode(); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs index 94eab564..f94248c5 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateAgentsFromTemplateNoProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( public async global::System.Threading.Tasks.Task TemplatesCreateAgentsFromTemplateNoProjectAsync( string templateVersion, + global::Letta.TemplatesCreateAgentsFromTemplateNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesCreateAgentsFromTemplateNoProjectAsResponseAsync( + templateVersion: templateVersion, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Agents From Template
+ /// Creates an Agent or multiple Agents from a template + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesCreateAgentsFromTemplateNoProjectAsResponseAsync( + string templateVersion, + global::Letta.TemplatesCreateAgentsFromTemplateNoProjectRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{templateVersion}/agents", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 402 @@ -376,9 +421,13 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesCreateAgentsFromTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesCreateAgentsFromTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessTemplatesCreateAgentsFromTemplateNoProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesCreateAgentsFromTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesCreateAgentsFromTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplate.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplate.g.cs index 2e7330b4..43f467e2 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplate.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesCreateTemplateResponseContent( public async global::System.Threading.Tasks.Task TemplatesCreateTemplateAsync( string projectId, + global::Letta.TemplatesCreateTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesCreateTemplateAsResponseAsync( + projectId: projectId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create template (Cloud-only)
+ /// Creates a new template from an existing agent or agent file + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesCreateTemplateAsResponseAsync( + string projectId, + global::Letta.TemplatesCreateTemplateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +127,7 @@ partial void ProcessTemplatesCreateTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}", baseUri: ResolveBaseUri( @@ -183,6 +210,8 @@ partial void ProcessTemplatesCreateTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -193,6 +222,11 @@ partial void ProcessTemplatesCreateTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -210,6 +244,8 @@ partial void ProcessTemplatesCreateTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -219,8 +255,7 @@ partial void ProcessTemplatesCreateTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -229,6 +264,11 @@ partial void ProcessTemplatesCreateTemplateResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -245,14 +285,15 @@ partial void ProcessTemplatesCreateTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -292,6 +333,8 @@ partial void ProcessTemplatesCreateTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -312,6 +355,8 @@ partial void ProcessTemplatesCreateTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -374,9 +419,13 @@ partial void ProcessTemplatesCreateTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesCreateTemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesCreateTemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,9 +453,13 @@ partial void ProcessTemplatesCreateTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesCreateTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesCreateTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplateNoProject.g.cs index d2eff7e7..96c4af09 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesCreateTemplateNoProject.g.cs @@ -64,6 +64,29 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( /// public async global::System.Threading.Tasks.Task TemplatesCreateTemplateNoProjectAsync( + global::Letta.TemplatesCreateTemplateNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesCreateTemplateNoProjectAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create template (Cloud-only)
+ /// Creates a new template from an existing agent or agent file + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesCreateTemplateNoProjectAsResponseAsync( + global::Letta.TemplatesCreateTemplateNoProjectRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +119,7 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/templates", baseUri: ResolveBaseUri( @@ -177,6 +201,8 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -187,6 +213,11 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -204,6 +235,8 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -213,8 +246,7 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -223,6 +255,11 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -239,14 +276,15 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -286,6 +324,8 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -306,6 +346,8 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -368,9 +410,13 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesCreateTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesCreateTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -398,9 +444,13 @@ partial void ProcessTemplatesCreateTemplateNoProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesCreateTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesCreateTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplate.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplate.g.cs index 70658dc9..d8e4bbcb 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplate.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( string projectId, string templateName, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesDeleteTemplateAsResponseAsync( + projectId: projectId, + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete template (Cloud-only)
+ /// Deletes all versions of a template with the specified name + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesDeleteTemplateAsResponseAsync( + string projectId, + string templateName, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -382,9 +430,13 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesDeleteTemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesDeleteTemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +464,13 @@ partial void ProcessTemplatesDeleteTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesDeleteTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesDeleteTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplateNoProject.g.cs index bafa46b8..72f834bb 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesDeleteTemplateNoProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( public async global::System.Threading.Tasks.Task TemplatesDeleteTemplateNoProjectAsync( string templateName, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesDeleteTemplateNoProjectAsResponseAsync( + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete template (Cloud-only)
+ /// Deletes all versions of a template with the specified name + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesDeleteTemplateNoProjectAsResponseAsync( + string templateName, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{templateName}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -376,9 +421,13 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesDeleteTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesDeleteTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessTemplatesDeleteTemplateNoProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesDeleteTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesDeleteTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesForkTemplate.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesForkTemplate.g.cs index 4cb53f9e..38a4b5aa 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesForkTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesForkTemplate.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesForkTemplateResponseContent( string projectId, string templateVersion, + global::Letta.TemplatesForkTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesForkTemplateAsResponseAsync( + projectId: projectId, + templateVersion: templateVersion, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fork template (Cloud-only)
+ /// Forks a template version into a new template + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesForkTemplateAsResponseAsync( + string projectId, + string templateVersion, + global::Letta.TemplatesForkTemplateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesForkTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateVersion}/fork", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesForkTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesForkTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesForkTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesForkTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesForkTemplateResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesForkTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesForkTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesForkTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -382,9 +430,13 @@ partial void ProcessTemplatesForkTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesForkTemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesForkTemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +464,13 @@ partial void ProcessTemplatesForkTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesForkTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesForkTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesGetTemplateSnapshot.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesGetTemplateSnapshot.g.cs index 495166c4..081b2a08 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesGetTemplateSnapshot.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesGetTemplateSnapshot.g.cs @@ -70,6 +70,30 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( string templateVersion, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesGetTemplateSnapshotAsResponseAsync( + projectId: projectId, + templateVersion: templateVersion, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get template snapshot (Cloud-only)
+ /// Get a snapshot of the template version, this will return the template state at a specific version + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesGetTemplateSnapshotAsResponseAsync( + string projectId, + string templateVersion, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateVersion}/snapshot", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -329,9 +372,13 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesGetTemplateSnapshotResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesGetTemplateSnapshotResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -359,9 +406,13 @@ partial void ProcessTemplatesGetTemplateSnapshotResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesGetTemplateSnapshotResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesGetTemplateSnapshotResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesLegacyMigration.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesLegacyMigration.g.cs index 9ee3f63f..75527257 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesLegacyMigration.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesLegacyMigration.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( public async global::System.Threading.Tasks.Task TemplatesLegacyMigrationAsync( string templateId, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesLegacyMigrationAsResponseAsync( + templateId: templateId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Migrate template from legacy project (Cloud-only)
+ /// Migrates a template from a legacy project to the default project. Only works if the template is currently in a legacy project. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesLegacyMigrationAsResponseAsync( + string templateId, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/legacy-templates/{templateId}/migrates", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -414,9 +459,13 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesLegacyMigrationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesLegacyMigrationResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -444,9 +493,13 @@ partial void ProcessTemplatesLegacyMigrationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesLegacyMigrationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesLegacyMigrationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplateVersions.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplateVersions.g.cs index 0798839b..e2ea6d4a 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplateVersions.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplateVersions.g.cs @@ -78,6 +78,36 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( string? limit = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesListTemplateVersionsAsResponseAsync( + projectId: projectId, + name: name, + offset: offset, + limit: limit, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List template versions (Cloud-only)
+ /// List all versions of a specific template + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesListTemplateVersionsAsResponseAsync( + string projectId, + string name, + global::Letta.OneOf? offset = default, + string? limit = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -110,14 +140,15 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{name}/versions", baseUri: ResolveBaseUri( servers: s_TemplatesListTemplateVersionsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit) + .AddOptionalParameter("limit", limit) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -192,6 +223,8 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +235,11 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +257,8 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +268,7 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +277,11 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +298,15 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +346,8 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +368,8 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 404 @@ -383,9 +432,13 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesListTemplateVersionsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesListTemplateVersionsResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -413,9 +466,13 @@ partial void ProcessTemplatesListTemplateVersionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesListTemplateVersionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesListTemplateVersionsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplates.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplates.g.cs index 18b07298..c40d644e 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplates.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesListTemplates.g.cs @@ -102,6 +102,54 @@ partial void ProcessTemplatesListTemplatesResponseContent( global::Letta.TemplatesListTemplatesSortBy? sortBy = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesListTemplatesAsResponseAsync( + offset: offset, + exact: exact, + limit: limit, + version: version, + templateId: templateId, + name: name, + search: search, + projectSlug: projectSlug, + projectId: projectId, + sortBy: sortBy, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List templates (Cloud-only)
+ /// List all templates + ///
+ /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesListTemplatesAsResponseAsync( + global::Letta.OneOf? offset = default, + string? exact = default, + string? limit = default, + string? version = default, + string? templateId = default, + string? name = default, + string? search = default, + string? projectSlug = default, + string? projectId = default, + global::Letta.TemplatesListTemplatesSortBy? sortBy = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -140,11 +188,12 @@ partial void ProcessTemplatesListTemplatesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/templates", baseUri: ResolveBaseUri( servers: s_TemplatesListTemplatesServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) .AddOptionalParameter("exact", exact) @@ -155,7 +204,7 @@ partial void ProcessTemplatesListTemplatesResponseContent( .AddOptionalParameter("search", search) .AddOptionalParameter("project_slug", projectSlug) .AddOptionalParameter("project_id", projectId) - .AddOptionalParameter("sort_by", sortBy?.ToValueString()) + .AddOptionalParameter("sort_by", sortBy?.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -236,6 +285,8 @@ partial void ProcessTemplatesListTemplatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -246,6 +297,11 @@ partial void ProcessTemplatesListTemplatesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -263,6 +319,8 @@ partial void ProcessTemplatesListTemplatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -272,8 +330,7 @@ partial void ProcessTemplatesListTemplatesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -282,6 +339,11 @@ partial void ProcessTemplatesListTemplatesResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -298,14 +360,15 @@ partial void ProcessTemplatesListTemplatesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -345,6 +408,8 @@ partial void ProcessTemplatesListTemplatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -365,6 +430,8 @@ partial void ProcessTemplatesListTemplatesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -389,9 +456,13 @@ partial void ProcessTemplatesListTemplatesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesListTemplatesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesListTemplatesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -419,9 +490,13 @@ partial void ProcessTemplatesListTemplatesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesListTemplatesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesListTemplatesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesMigrateDeployment.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesMigrateDeployment.g.cs index 5f6c59bf..ebeb58ab 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesMigrateDeployment.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesMigrateDeployment.g.cs @@ -76,6 +76,38 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( string templateName, string deploymentId, + global::Letta.TemplatesMigrateDeploymentRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesMigrateDeploymentAsResponseAsync( + projectId: projectId, + templateName: templateName, + deploymentId: deploymentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Migrate deployment to template version (Cloud-only)
+ /// Migrates a deployment to a specific template version + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesMigrateDeploymentAsResponseAsync( + string projectId, + string templateName, + string deploymentId, + global::Letta.TemplatesMigrateDeploymentRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -113,6 +145,7 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}/deployments/{deploymentId}/migrate", baseUri: ResolveBaseUri( @@ -197,6 +230,8 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -207,6 +242,11 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -224,6 +264,8 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -233,8 +275,7 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -243,6 +284,11 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -259,14 +305,15 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -306,6 +353,8 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -326,6 +375,8 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -464,9 +515,13 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesMigrateDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesMigrateDeploymentResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -494,9 +549,13 @@ partial void ProcessTemplatesMigrateDeploymentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesMigrateDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesMigrateDeploymentResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRenameTemplate.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRenameTemplate.g.cs index 70f73ca0..1cdea27f 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRenameTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRenameTemplate.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesRenameTemplateResponseContent( string projectId, string templateName, + global::Letta.TemplatesRenameTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesRenameTemplateAsResponseAsync( + projectId: projectId, + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Rename template (Cloud-only)
+ /// Renames all versions of a template with the specified name. Versions are automatically stripped from the current template name if accidentally included. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesRenameTemplateAsResponseAsync( + string projectId, + string templateName, + global::Letta.TemplatesRenameTemplateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesRenameTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}/name", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesRenameTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesRenameTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesRenameTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesRenameTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesRenameTemplateResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesRenameTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesRenameTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesRenameTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -458,9 +506,13 @@ partial void ProcessTemplatesRenameTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesRenameTemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesRenameTemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -488,9 +540,13 @@ partial void ProcessTemplatesRenameTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesRenameTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesRenameTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplate.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplate.g.cs index 759edbdb..81c38a2a 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplate.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplate.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( string projectId, string templateName, + global::Letta.TemplatesRollbackTemplateRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesRollbackTemplateAsResponseAsync( + projectId: projectId, + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Rollback template to previous version (Cloud-only)
+ /// Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesRollbackTemplateAsResponseAsync( + string projectId, + string templateName, + global::Letta.TemplatesRollbackTemplateRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}/rollback", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -458,9 +506,13 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesRollbackTemplateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesRollbackTemplateResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -488,9 +540,13 @@ partial void ProcessTemplatesRollbackTemplateResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesRollbackTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesRollbackTemplateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplateNoProject.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplateNoProject.g.cs index cb74d2b0..37faffda 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplateNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesRollbackTemplateNoProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( public async global::System.Threading.Tasks.Task TemplatesRollbackTemplateNoProjectAsync( string templateName, + global::Letta.TemplatesRollbackTemplateNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesRollbackTemplateNoProjectAsResponseAsync( + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Rollback template to previous version (Cloud-only)
+ /// Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesRollbackTemplateNoProjectAsResponseAsync( + string templateName, + global::Letta.TemplatesRollbackTemplateNoProjectRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{templateName}/rollback", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -452,9 +497,13 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesRollbackTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesRollbackTemplateNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -482,9 +531,13 @@ partial void ProcessTemplatesRollbackTemplateNoProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesRollbackTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesRollbackTemplateNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersion.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersion.g.cs index b0fc7390..4c01a518 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersion.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersion.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( string projectId, string templateName, + global::Letta.TemplatesSaveTemplateVersionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesSaveTemplateVersionAsResponseAsync( + projectId: projectId, + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Save template version (Cloud-only)
+ /// Saves the current version of the template as a new version + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesSaveTemplateVersionAsResponseAsync( + string projectId, + string templateName, + global::Letta.TemplatesSaveTemplateVersionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -382,9 +430,13 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesSaveTemplateVersionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesSaveTemplateVersionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -412,9 +464,13 @@ partial void ProcessTemplatesSaveTemplateVersionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesSaveTemplateVersionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesSaveTemplateVersionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs index 439a4cca..acce12dd 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSaveTemplateVersionNoProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( public async global::System.Threading.Tasks.Task TemplatesSaveTemplateVersionNoProjectAsync( string templateName, + global::Letta.TemplatesSaveTemplateVersionNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesSaveTemplateVersionNoProjectAsResponseAsync( + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Save template version (Cloud-only)
+ /// Saves the current version of the template as a new version + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesSaveTemplateVersionNoProjectAsResponseAsync( + string templateName, + global::Letta.TemplatesSaveTemplateVersionNoProjectRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{templateName}/save", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -376,9 +421,13 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesSaveTemplateVersionNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesSaveTemplateVersionNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -406,9 +455,13 @@ partial void ProcessTemplatesSaveTemplateVersionNoProjectResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesSaveTemplateVersionNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesSaveTemplateVersionNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs index ac2c71ef..7febe274 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesSetCurrentTemplateFromSnapshot.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( string projectId, string templateVersion, + object request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesSetCurrentTemplateFromSnapshotAsResponseAsync( + projectId: projectId, + templateVersion: templateVersion, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Set current template from snapshot (Cloud-only)
+ /// Updates the current working version of a template from a snapshot + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesSetCurrentTemplateFromSnapshotAsResponseAsync( + string projectId, + string templateVersion, + object request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateVersion}/snapshot", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -458,9 +506,13 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesSetCurrentTemplateFromSnapshotResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesSetCurrentTemplateFromSnapshotResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -488,9 +540,13 @@ partial void ProcessTemplatesSetCurrentTemplateFromSnapshotResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesSetCurrentTemplateFromSnapshotResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesSetCurrentTemplateFromSnapshotResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs index 744d3a0f..3ca7dcb6 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFile.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( string projectId, string templateName, + global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesUpdateCurrentTemplateFromAgentFileAsResponseAsync( + projectId: projectId, + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update current template from agent file (Cloud-only)
+ /// Updates the current working version of a template from an agent file + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesUpdateCurrentTemplateFromAgentFileAsResponseAsync( + string projectId, + string templateName, + global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}/agent-file", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -458,9 +506,13 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -488,9 +540,13 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs index f3531508..26a9cb29 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateCurrentTemplateFromAgentFileNoProject.g.cs @@ -68,6 +68,32 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse public async global::System.Threading.Tasks.Task TemplatesUpdateCurrentTemplateFromAgentFileNoProjectAsync( string templateName, + global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesUpdateCurrentTemplateFromAgentFileNoProjectAsResponseAsync( + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update current template from agent file (Cloud-only)
+ /// Updates the current working version of a template from an agent file + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesUpdateCurrentTemplateFromAgentFileNoProjectAsResponseAsync( + string templateName, + global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -103,6 +129,7 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{templateName}", baseUri: ResolveBaseUri( @@ -185,6 +212,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -195,6 +224,11 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -212,6 +246,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -221,8 +257,7 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -231,6 +266,11 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -247,14 +287,15 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -294,6 +335,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -314,6 +357,8 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -452,9 +497,13 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -482,9 +531,13 @@ partial void ProcessTemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesUpdateCurrentTemplateFromAgentFileNoProjectResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateTemplateDescription.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateTemplateDescription.g.cs index 949ad318..59a076c4 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateTemplateDescription.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.TemplatesUpdateTemplateDescription.g.cs @@ -72,6 +72,35 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( string projectId, string templateName, + global::Letta.TemplatesUpdateTemplateDescriptionRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TemplatesUpdateTemplateDescriptionAsResponseAsync( + projectId: projectId, + templateName: templateName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update template description (Cloud-only)
+ /// Updates the description for all versions of a template with the specified name. Versions are automatically stripped from the current template name if accidentally included. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TemplatesUpdateTemplateDescriptionAsResponseAsync( + string projectId, + string templateName, + global::Letta.TemplatesUpdateTemplateDescriptionRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -108,6 +137,7 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/templates/{projectId}/{templateName}/description", baseUri: ResolveBaseUri( @@ -191,6 +221,8 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +233,11 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -218,6 +255,8 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +266,7 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +275,11 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -253,14 +296,15 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -300,6 +344,8 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +366,8 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // 400 @@ -420,9 +468,13 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.TemplatesUpdateTemplateDescriptionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.TemplatesUpdateTemplateDescriptionResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -450,9 +502,13 @@ partial void ProcessTemplatesUpdateTemplateDescriptionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.TemplatesUpdateTemplateDescriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.TemplatesUpdateTemplateDescriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.TemplatesClient.g.cs b/src/libs/Letta/Generated/Letta.TemplatesClient.g.cs index 0829345b..fdb66ffa 100644 --- a/src/libs/Letta/Generated/Letta.TemplatesClient.g.cs +++ b/src/libs/Letta/Generated/Letta.TemplatesClient.g.cs @@ -103,10 +103,10 @@ public TemplatesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public TemplatesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.AddBaseTools.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.AddBaseTools.g.cs index 5eab9365..8dcf20c3 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.AddBaseTools.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.AddBaseTools.g.cs @@ -62,6 +62,24 @@ partial void ProcessAddBaseToolsResponseContent( public async global::System.Threading.Tasks.Task> AddBaseToolsAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddBaseToolsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upsert Base Tools
+ /// Upsert base tools + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> AddBaseToolsAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessAddBaseToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/add-base-tools", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessAddBaseToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessAddBaseToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessAddBaseToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessAddBaseToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessAddBaseToolsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessAddBaseToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessAddBaseToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessAddBaseToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -355,9 +392,13 @@ partial void ProcessAddBaseToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -385,9 +426,13 @@ partial void ProcessAddBaseToolsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpServer.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpServer.g.cs index 2986fd9a..d84692f0 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpServer.g.cs @@ -64,6 +64,29 @@ partial void ProcessAddMcpServerResponseContent( /// public async global::System.Threading.Tasks.Task>> AddMcpServerAsync( + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddMcpServerAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add Mcp Server To Config
+ /// Add a new MCP server to the Letta MCP server config + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>>> AddMcpServerAsResponseAsync( + global::Letta.AnyOf request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -96,6 +119,7 @@ partial void ProcessAddMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/mcp/servers", baseUri: ResolveBaseUri( @@ -177,6 +201,8 @@ partial void ProcessAddMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -187,6 +213,11 @@ partial void ProcessAddMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -204,6 +235,8 @@ partial void ProcessAddMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -213,8 +246,7 @@ partial void ProcessAddMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -223,6 +255,11 @@ partial void ProcessAddMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -239,14 +276,15 @@ partial void ProcessAddMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -286,6 +324,8 @@ partial void ProcessAddMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -306,6 +346,8 @@ partial void ProcessAddMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -368,9 +410,13 @@ partial void ProcessAddMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -398,9 +444,13 @@ partial void ProcessAddMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpTool.g.cs index e4219a49..1ce59f71 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.AddMcpTool.g.cs @@ -70,6 +70,30 @@ partial void ProcessAddMcpToolResponseContent( string mcpToolName, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddMcpToolAsResponseAsync( + mcpServerName: mcpServerName, + mcpToolName: mcpToolName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add Mcp Tool
+ /// Register a new MCP tool as a Letta server by MCP server + tool name + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AddMcpToolAsResponseAsync( + string mcpServerName, + string mcpToolName, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -100,6 +124,7 @@ partial void ProcessAddMcpToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/mcp/servers/{mcpServerName}/{mcpToolName}", baseUri: ResolveBaseUri( @@ -176,6 +201,8 @@ partial void ProcessAddMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +213,11 @@ partial void ProcessAddMcpToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -203,6 +235,8 @@ partial void ProcessAddMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +246,7 @@ partial void ProcessAddMcpToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +255,11 @@ partial void ProcessAddMcpToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -238,14 +276,15 @@ partial void ProcessAddMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -285,6 +324,8 @@ partial void ProcessAddMcpToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +346,8 @@ partial void ProcessAddMcpToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -367,9 +410,13 @@ partial void ProcessAddMcpToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -397,9 +444,13 @@ partial void ProcessAddMcpToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ConnectMcpServer.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ConnectMcpServer.g.cs index a4f6709f..4d7aae9d 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ConnectMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ConnectMcpServer.g.cs @@ -65,6 +65,30 @@ partial void ProcessConnectMcpServerResponseContent( /// public async global::System.Threading.Tasks.Task ConnectMcpServerAsync( + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ConnectMcpServerAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Connect Mcp Server
+ /// Connect to an MCP server with support for OAuth via SSE.
+ /// Returns a stream of events handling authorization state and exchange if OAuth is required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ConnectMcpServerAsResponseAsync( + global::Letta.AnyOf request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,6 +121,7 @@ partial void ProcessConnectMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/mcp/servers/connect", baseUri: ResolveBaseUri( @@ -178,6 +203,8 @@ partial void ProcessConnectMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +215,11 @@ partial void ProcessConnectMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +237,8 @@ partial void ProcessConnectMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +248,7 @@ partial void ProcessConnectMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +257,11 @@ partial void ProcessConnectMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +278,15 @@ partial void ProcessConnectMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +326,8 @@ partial void ProcessConnectMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +348,8 @@ partial void ProcessConnectMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +412,11 @@ partial void ProcessConnectMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +444,11 @@ partial void ProcessConnectMcpServerResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.CountTools.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.CountTools.g.cs index 0b42f273..68f1f5d0 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.CountTools.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.CountTools.g.cs @@ -110,6 +110,64 @@ partial void ProcessCountToolsResponseContent( bool? excludeLettaTools = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CountToolsAsResponseAsync( + name: name, + names: names, + toolIds: toolIds, + search: search, + toolTypes: toolTypes, + excludeToolTypes: excludeToolTypes, + returnOnlyLettaTools: returnOnlyLettaTools, + excludeLettaTools: excludeLettaTools, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Count Tools
+ /// Get a count of all tools available to agents belonging to the org of the user. + ///
+ /// + /// + /// Filter by specific tool names + /// + /// + /// Filter by specific tool IDs - accepts repeated params or comma-separated values + /// + /// + /// Search tool names (case-insensitive partial match) + /// + /// + /// Filter by tool type(s) - accepts repeated params or comma-separated values + /// + /// + /// Tool type(s) to exclude - accepts repeated params or comma-separated values + /// + /// + /// Count only tools with tool_type starting with 'letta_'
+ /// Default Value: false + /// + /// + /// Exclude built-in Letta tools from the count
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CountToolsAsResponseAsync( + string? name = default, + global::System.Collections.Generic.IList? names = default, + global::System.Collections.Generic.IList? toolIds = default, + string? search = default, + global::System.Collections.Generic.IList? toolTypes = default, + global::System.Collections.Generic.IList? excludeToolTypes = default, + bool? returnOnlyLettaTools = default, + bool? excludeLettaTools = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -146,11 +204,12 @@ partial void ProcessCountToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/count", baseUri: ResolveBaseUri( servers: s_CountToolsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("name", name) .AddOptionalParameter("names", names?.ToString()) @@ -159,7 +218,7 @@ partial void ProcessCountToolsResponseContent( .AddOptionalParameter("tool_types", toolTypes?.ToString()) .AddOptionalParameter("exclude_tool_types", excludeToolTypes?.ToString()) .AddOptionalParameter("return_only_letta_tools", returnOnlyLettaTools?.ToString().ToLowerInvariant()) - .AddOptionalParameter("exclude_letta_tools", excludeLettaTools?.ToString().ToLowerInvariant()) + .AddOptionalParameter("exclude_letta_tools", excludeLettaTools?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -238,6 +297,8 @@ partial void ProcessCountToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -248,6 +309,11 @@ partial void ProcessCountToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -265,6 +331,8 @@ partial void ProcessCountToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -274,8 +342,7 @@ partial void ProcessCountToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -284,6 +351,11 @@ partial void ProcessCountToolsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -300,14 +372,15 @@ partial void ProcessCountToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -347,6 +420,8 @@ partial void ProcessCountToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -367,6 +442,8 @@ partial void ProcessCountToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -429,9 +506,13 @@ partial void ProcessCountToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? + var __value = (int?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(int?), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -459,9 +540,13 @@ partial void ProcessCountToolsResponseContent( #endif ).ConfigureAwait(false); - return - (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (int?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(int?), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.CreateTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.CreateTool.g.cs index 918deab6..d7ec940e 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.CreateTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.CreateTool.g.cs @@ -64,6 +64,29 @@ partial void ProcessCreateToolResponseContent( /// public async global::System.Threading.Tasks.Task CreateToolAsync( + global::Letta.ToolCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateToolAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Tool
+ /// Create a new tool + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateToolAsResponseAsync( + global::Letta.ToolCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessCreateToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessCreateToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessCreateToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessCreateToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessCreateToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessCreateToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessCreateToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessCreateToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessCreateToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessCreateToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessCreateToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.DeleteMcpServer.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.DeleteMcpServer.g.cs index 67ef9fcd..de813b03 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.DeleteMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.DeleteMcpServer.g.cs @@ -66,6 +66,27 @@ partial void ProcessDeleteMcpServerResponseContent( string mcpServerName, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteMcpServerAsResponseAsync( + mcpServerName: mcpServerName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Mcp Server From Config
+ /// Delete a MCP server configuration + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>>> DeleteMcpServerAsResponseAsync( + string mcpServerName, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessDeleteMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/mcp/servers/{mcpServerName}", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessDeleteMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessDeleteMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessDeleteMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessDeleteMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessDeleteMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessDeleteMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessDeleteMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessDeleteMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessDeleteMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessDeleteMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.DeleteTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.DeleteTool.g.cs index a2ca2145..5aa6b893 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.DeleteTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.DeleteTool.g.cs @@ -68,6 +68,29 @@ partial void ProcessDeleteToolResponseContent( string toolId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteToolAsResponseAsync( + toolId: toolId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Tool
+ /// Delete a tool by name + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteToolAsResponseAsync( + string toolId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessDeleteToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/{toolId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessDeleteToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessDeleteToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessDeleteToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessDeleteToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessDeleteToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessDeleteToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessDeleteToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessDeleteToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,7 +405,11 @@ partial void ProcessDeleteToolResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -391,7 +437,11 @@ partial void ProcessDeleteToolResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ExecuteMcpTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ExecuteMcpTool.g.cs index c554d80b..d69708e0 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ExecuteMcpTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ExecuteMcpTool.g.cs @@ -73,6 +73,36 @@ partial void ProcessExecuteMcpToolResponseContent( string mcpServerName, string toolName, + global::Letta.LettaServerRestApiRoutersV1ToolsToolExecuteRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExecuteMcpToolAsResponseAsync( + mcpServerName: mcpServerName, + toolName: toolName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Execute Mcp Tool
+ /// Execute a specific MCP tool from a configured server.
+ /// Returns the tool execution result. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ExecuteMcpToolAsResponseAsync( + string mcpServerName, + string toolName, + global::Letta.LettaServerRestApiRoutersV1ToolsToolExecuteRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -109,6 +139,7 @@ partial void ProcessExecuteMcpToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/mcp/servers/{mcpServerName}/tools/{toolName}/execute", baseUri: ResolveBaseUri( @@ -192,6 +223,8 @@ partial void ProcessExecuteMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -202,6 +235,11 @@ partial void ProcessExecuteMcpToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -219,6 +257,8 @@ partial void ProcessExecuteMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -228,8 +268,7 @@ partial void ProcessExecuteMcpToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -238,6 +277,11 @@ partial void ProcessExecuteMcpToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -254,14 +298,15 @@ partial void ProcessExecuteMcpToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -301,6 +346,8 @@ partial void ProcessExecuteMcpToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -321,6 +368,8 @@ partial void ProcessExecuteMcpToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -383,7 +432,11 @@ partial void ProcessExecuteMcpToolResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -411,7 +464,11 @@ partial void ProcessExecuteMcpToolResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpServers.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpServers.g.cs index 59d200bb..75110112 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpServers.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpServers.g.cs @@ -62,6 +62,24 @@ partial void ProcessListMcpServersResponseContent( public async global::System.Threading.Tasks.Task ListMcpServersAsync( global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMcpServersAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Mcp Servers
+ /// Get a list of all configured MCP servers + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListMcpServersAsResponseAsync( + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -90,6 +108,7 @@ partial void ProcessListMcpServersResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/mcp/servers", baseUri: ResolveBaseUri( @@ -164,6 +183,8 @@ partial void ProcessListMcpServersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +195,11 @@ partial void ProcessListMcpServersResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -191,6 +217,8 @@ partial void ProcessListMcpServersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -200,8 +228,7 @@ partial void ProcessListMcpServersResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -210,6 +237,11 @@ partial void ProcessListMcpServersResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -226,14 +258,15 @@ partial void ProcessListMcpServersResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +306,8 @@ partial void ProcessListMcpServersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +328,8 @@ partial void ProcessListMcpServersResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -355,7 +392,11 @@ partial void ProcessListMcpServersResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -383,7 +424,11 @@ partial void ProcessListMcpServersResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpToolsByServer.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpToolsByServer.g.cs index dfc3ab9e..64764d15 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpToolsByServer.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ListMcpToolsByServer.g.cs @@ -66,6 +66,27 @@ partial void ProcessListMcpToolsByServerResponseContent( string mcpServerName, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListMcpToolsByServerAsResponseAsync( + mcpServerName: mcpServerName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Mcp Tools By Server
+ /// Get a list of all tools for a specific MCP server + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListMcpToolsByServerAsResponseAsync( + string mcpServerName, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,6 +116,7 @@ partial void ProcessListMcpToolsByServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/mcp/servers/{mcpServerName}/tools", baseUri: ResolveBaseUri( @@ -170,6 +192,8 @@ partial void ProcessListMcpToolsByServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +204,11 @@ partial void ProcessListMcpToolsByServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +226,8 @@ partial void ProcessListMcpToolsByServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +237,7 @@ partial void ProcessListMcpToolsByServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +246,11 @@ partial void ProcessListMcpToolsByServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +267,15 @@ partial void ProcessListMcpToolsByServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +315,8 @@ partial void ProcessListMcpToolsByServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +337,8 @@ partial void ProcessListMcpToolsByServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -361,9 +401,13 @@ partial void ProcessListMcpToolsByServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -391,9 +435,13 @@ partial void ProcessListMcpToolsByServerResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ListTools.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ListTools.g.cs index 93475795..46efa384 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ListTools.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ListTools.g.cs @@ -138,6 +138,88 @@ partial void ProcessListToolsResponseContent( bool? returnOnlyLettaTools = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListToolsAsResponseAsync( + before: before, + after: after, + limit: limit, + order: order, + orderBy: orderBy, + name: name, + names: names, + toolIds: toolIds, + search: search, + toolTypes: toolTypes, + excludeToolTypes: excludeToolTypes, + returnOnlyLettaTools: returnOnlyLettaTools, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Tools
+ /// Get a list of all tools available to agents. + ///
+ /// + /// Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order + /// + /// + /// Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order + /// + /// + /// Maximum number of tools to return
+ /// Default Value: 50 + /// + /// + /// Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
+ /// Default Value: desc + /// + /// + /// Field to sort by
+ /// Default Value: created_at + /// + /// + /// Filter by single tool name + /// + /// + /// Filter by specific tool names + /// + /// + /// Filter by specific tool IDs - accepts repeated params or comma-separated values + /// + /// + /// Search tool names (case-insensitive partial match) + /// + /// + /// Filter by tool type(s) - accepts repeated params or comma-separated values + /// + /// + /// Tool type(s) to exclude - accepts repeated params or comma-separated values + /// + /// + /// Return only tools with tool_type starting with 'letta_'
+ /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListToolsAsResponseAsync( + string? before = default, + string? after = default, + int? limit = default, + global::Letta.ListToolsOrder? order = default, + string? orderBy = default, + string? name = default, + global::System.Collections.Generic.IList? names = default, + global::System.Collections.Generic.IList? toolIds = default, + string? search = default, + global::System.Collections.Generic.IList? toolTypes = default, + global::System.Collections.Generic.IList? excludeToolTypes = default, + bool? returnOnlyLettaTools = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -178,11 +260,12 @@ partial void ProcessListToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/", baseUri: ResolveBaseUri( servers: s_ListToolsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("before", before) .AddOptionalParameter("after", after) @@ -195,7 +278,7 @@ partial void ProcessListToolsResponseContent( .AddOptionalParameter("search", search) .AddOptionalParameter("tool_types", toolTypes?.ToString()) .AddOptionalParameter("exclude_tool_types", excludeToolTypes?.ToString()) - .AddOptionalParameter("return_only_letta_tools", returnOnlyLettaTools?.ToString().ToLowerInvariant()) + .AddOptionalParameter("return_only_letta_tools", returnOnlyLettaTools?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -278,6 +361,8 @@ partial void ProcessListToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -288,6 +373,11 @@ partial void ProcessListToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -305,6 +395,8 @@ partial void ProcessListToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -314,8 +406,7 @@ partial void ProcessListToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -324,6 +415,11 @@ partial void ProcessListToolsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -340,14 +436,15 @@ partial void ProcessListToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -387,6 +484,8 @@ partial void ProcessListToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -407,6 +506,8 @@ partial void ProcessListToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -469,9 +570,13 @@ partial void ProcessListToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -499,9 +604,13 @@ partial void ProcessListToolsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.McpOauthCallback.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.McpOauthCallback.g.cs index cd6319c5..dfccd85e 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.McpOauthCallback.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.McpOauthCallback.g.cs @@ -87,6 +87,45 @@ partial void ProcessMcpOauthCallbackResponseContent( string? errorDescription = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await McpOauthCallbackAsResponseAsync( + code: code, + state: state, + error: error, + errorDescription: errorDescription, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Mcp Oauth Callback
+ /// Handle OAuth callback for MCP server authentication.
+ /// Session is identified via the state parameter instead of URL path. + ///
+ /// + /// OAuth authorization code + /// + /// + /// OAuth state parameter + /// + /// + /// OAuth error + /// + /// + /// OAuth error description + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> McpOauthCallbackAsResponseAsync( + string? code = default, + string? state = default, + string? error = default, + string? errorDescription = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -119,16 +158,17 @@ partial void ProcessMcpOauthCallbackResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/mcp/oauth/callback", baseUri: ResolveBaseUri( servers: s_McpOauthCallbackServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder .AddOptionalParameter("code", code) .AddOptionalParameter("state", state) .AddOptionalParameter("error", error) - .AddOptionalParameter("error_description", errorDescription) + .AddOptionalParameter("error_description", errorDescription) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -203,6 +243,8 @@ partial void ProcessMcpOauthCallbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -213,6 +255,11 @@ partial void ProcessMcpOauthCallbackResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -230,6 +277,8 @@ partial void ProcessMcpOauthCallbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -239,8 +288,7 @@ partial void ProcessMcpOauthCallbackResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -249,6 +297,11 @@ partial void ProcessMcpOauthCallbackResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -265,14 +318,15 @@ partial void ProcessMcpOauthCallbackResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -312,6 +366,8 @@ partial void ProcessMcpOauthCallbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -332,6 +388,8 @@ partial void ProcessMcpOauthCallbackResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -394,7 +452,11 @@ partial void ProcessMcpOauthCallbackResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -422,7 +484,11 @@ partial void ProcessMcpOauthCallbackResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ModifyTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ModifyTool.g.cs index 238b9d14..743a9194 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ModifyTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ModifyTool.g.cs @@ -70,6 +70,34 @@ partial void ProcessModifyToolResponseContent( public async global::System.Threading.Tasks.Task ModifyToolAsync( string toolId, + global::Letta.ToolUpdate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModifyToolAsResponseAsync( + toolId: toolId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Modify Tool
+ /// Update an existing tool + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModifyToolAsResponseAsync( + string toolId, + global::Letta.ToolUpdate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -105,6 +133,7 @@ partial void ProcessModifyToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/{toolId}", baseUri: ResolveBaseUri( @@ -187,6 +216,8 @@ partial void ProcessModifyToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +228,11 @@ partial void ProcessModifyToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -214,6 +250,8 @@ partial void ProcessModifyToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +261,7 @@ partial void ProcessModifyToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +270,11 @@ partial void ProcessModifyToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -249,14 +291,15 @@ partial void ProcessModifyToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -296,6 +339,8 @@ partial void ProcessModifyToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +361,8 @@ partial void ProcessModifyToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +425,13 @@ partial void ProcessModifyToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -408,9 +459,13 @@ partial void ProcessModifyToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.ResyncMcpServerTools.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.ResyncMcpServerTools.g.cs index e098d006..409af8a0 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.ResyncMcpServerTools.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.ResyncMcpServerTools.g.cs @@ -75,6 +75,35 @@ partial void ProcessResyncMcpServerToolsResponseContent( string? agentId = default, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ResyncMcpServerToolsAsResponseAsync( + mcpServerName: mcpServerName, + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Resync Mcp Server Tools
+ /// Resync tools for an MCP server by:
+ /// 1. Fetching current tools from the MCP server
+ /// 2. Deleting tools that no longer exist on the server
+ /// 3. Updating schemas for existing tools
+ /// 4. Adding new tools from the server
+ /// Returns a summary of changes made. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ResyncMcpServerToolsAsResponseAsync( + string mcpServerName, + string? agentId = default, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -105,13 +134,14 @@ partial void ProcessResyncMcpServerToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/mcp/servers/{mcpServerName}/resync", baseUri: ResolveBaseUri( servers: s_ResyncMcpServerToolsServers, - defaultBaseUrl: "https://app.letta.com/")); + defaultBaseUrl: "https://app.letta.com/")); __pathBuilder - .AddOptionalParameter("agent_id", agentId) + .AddOptionalParameter("agent_id", agentId) ; var __path = __pathBuilder.ToString(); __path = global::Letta.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -184,6 +214,8 @@ partial void ProcessResyncMcpServerToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -194,6 +226,11 @@ partial void ProcessResyncMcpServerToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -211,6 +248,8 @@ partial void ProcessResyncMcpServerToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -220,8 +259,7 @@ partial void ProcessResyncMcpServerToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -230,6 +268,11 @@ partial void ProcessResyncMcpServerToolsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -246,14 +289,15 @@ partial void ProcessResyncMcpServerToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -293,6 +337,8 @@ partial void ProcessResyncMcpServerToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -313,6 +359,8 @@ partial void ProcessResyncMcpServerToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -375,7 +423,11 @@ partial void ProcessResyncMcpServerToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -403,7 +455,11 @@ partial void ProcessResyncMcpServerToolsResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.RetrieveTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.RetrieveTool.g.cs index 4859c980..eda3b4ec 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.RetrieveTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.RetrieveTool.g.cs @@ -68,6 +68,29 @@ partial void ProcessRetrieveToolResponseContent( string toolId, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveToolAsResponseAsync( + toolId: toolId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Tool
+ /// Get a tool by ID + ///
+ /// + /// The ID of the tool in the format 'tool-<uuid4>' + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RetrieveToolAsResponseAsync( + string toolId, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,6 +120,7 @@ partial void ProcessRetrieveToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/{toolId}", baseUri: ResolveBaseUri( @@ -172,6 +196,8 @@ partial void ProcessRetrieveToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessRetrieveToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessRetrieveToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessRetrieveToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessRetrieveToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessRetrieveToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessRetrieveToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessRetrieveToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -363,9 +405,13 @@ partial void ProcessRetrieveToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessRetrieveToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.RunToolFromSource.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.RunToolFromSource.g.cs index b16f1f68..699577da 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.RunToolFromSource.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.RunToolFromSource.g.cs @@ -64,6 +64,29 @@ partial void ProcessRunToolFromSourceResponseContent( /// public async global::System.Threading.Tasks.Task RunToolFromSourceAsync( + global::Letta.ToolRunFromSource request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunToolFromSourceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Tool From Source
+ /// Attempt to build a tool from source, then run it on the provided arguments + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RunToolFromSourceAsResponseAsync( + global::Letta.ToolRunFromSource request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessRunToolFromSourceResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/run", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessRunToolFromSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessRunToolFromSourceResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessRunToolFromSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessRunToolFromSourceResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessRunToolFromSourceResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessRunToolFromSourceResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessRunToolFromSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessRunToolFromSourceResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessRunToolFromSourceResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.ToolReturnMessage.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.ToolReturnMessage.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessRunToolFromSourceResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.ToolReturnMessage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.ToolReturnMessage.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.SearchTools.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.SearchTools.g.cs index aaa0fd19..3ca6ffad 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.SearchTools.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.SearchTools.g.cs @@ -67,6 +67,32 @@ partial void ProcessSearchToolsResponseContent( /// public async global::System.Threading.Tasks.Task> SearchToolsAsync( + global::Letta.ToolSearchRequest request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SearchToolsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Search Tools
+ /// Search tools using semantic search.
+ /// Requires tool embedding to be enabled (embed_tools=True). Uses vector search,
+ /// full-text search, or hybrid mode to find tools matching the query.
+ /// Returns tools ranked by relevance with their search scores. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> SearchToolsAsResponseAsync( + global::Letta.ToolSearchRequest request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +127,7 @@ partial void ProcessSearchToolsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/search", baseUri: ResolveBaseUri( @@ -182,6 +209,8 @@ partial void ProcessSearchToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +221,11 @@ partial void ProcessSearchToolsResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -209,6 +243,8 @@ partial void ProcessSearchToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +254,7 @@ partial void ProcessSearchToolsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +263,11 @@ partial void ProcessSearchToolsResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -244,14 +284,15 @@ partial void ProcessSearchToolsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -291,6 +332,8 @@ partial void ProcessSearchToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +354,8 @@ partial void ProcessSearchToolsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -373,9 +418,13 @@ partial void ProcessSearchToolsResponseContent( { __response.EnsureSuccessStatusCode(); - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -403,9 +452,13 @@ partial void ProcessSearchToolsResponseContent( #endif ).ConfigureAwait(false); - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.TestMcpServer.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.TestMcpServer.g.cs index 042fec4f..1997ca3d 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.TestMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.TestMcpServer.g.cs @@ -65,6 +65,30 @@ partial void ProcessTestMcpServerResponseContent( /// public async global::System.Threading.Tasks.Task TestMcpServerAsync( + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TestMcpServerAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Test Mcp Server
+ /// Test connection to an MCP server without adding it.
+ /// Returns the list of available tools if successful. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TestMcpServerAsResponseAsync( + global::Letta.AnyOf request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -97,6 +121,7 @@ partial void ProcessTestMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/mcp/servers/test", baseUri: ResolveBaseUri( @@ -178,6 +203,8 @@ partial void ProcessTestMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +215,11 @@ partial void ProcessTestMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -205,6 +237,8 @@ partial void ProcessTestMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +248,7 @@ partial void ProcessTestMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +257,11 @@ partial void ProcessTestMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -240,14 +278,15 @@ partial void ProcessTestMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -287,6 +326,8 @@ partial void ProcessTestMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +348,8 @@ partial void ProcessTestMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,7 +412,11 @@ partial void ProcessTestMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -397,7 +444,11 @@ partial void ProcessTestMcpServerResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.UpdateMcpServer.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.UpdateMcpServer.g.cs index 0b43397c..da8d62b3 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.UpdateMcpServer.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.UpdateMcpServer.g.cs @@ -68,6 +68,32 @@ partial void ProcessUpdateMcpServerResponseContent( public async global::System.Threading.Tasks.Task> UpdateMcpServerAsync( string mcpServerName, + global::Letta.AnyOf request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateMcpServerAsResponseAsync( + mcpServerName: mcpServerName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Mcp Server
+ /// Update an existing MCP server configuration + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> UpdateMcpServerAsResponseAsync( + string mcpServerName, + global::Letta.AnyOf request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -101,6 +127,7 @@ partial void ProcessUpdateMcpServerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: $"/v1/tools/mcp/servers/{mcpServerName}", baseUri: ResolveBaseUri( @@ -183,6 +210,8 @@ partial void ProcessUpdateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -193,6 +222,11 @@ partial void ProcessUpdateMcpServerResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -210,6 +244,8 @@ partial void ProcessUpdateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -219,8 +255,7 @@ partial void ProcessUpdateMcpServerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -229,6 +264,11 @@ partial void ProcessUpdateMcpServerResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -245,14 +285,15 @@ partial void ProcessUpdateMcpServerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -292,6 +333,8 @@ partial void ProcessUpdateMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -312,6 +355,8 @@ partial void ProcessUpdateMcpServerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -374,9 +419,13 @@ partial void ProcessUpdateMcpServerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.AnyOf.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -404,9 +453,13 @@ partial void ProcessUpdateMcpServerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.UpsertTool.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.UpsertTool.g.cs index d8766f75..eab95a48 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.UpsertTool.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.UpsertTool.g.cs @@ -64,6 +64,29 @@ partial void ProcessUpsertToolResponseContent( /// public async global::System.Threading.Tasks.Task UpsertToolAsync( + global::Letta.ToolCreate request, + global::Letta.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpsertToolAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upsert Tool
+ /// Create or update a tool + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UpsertToolAsResponseAsync( + global::Letta.ToolCreate request, global::Letta.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -98,6 +121,7 @@ partial void ProcessUpsertToolResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Letta.PathBuilder( path: "/v1/tools/", baseUri: ResolveBaseUri( @@ -179,6 +203,8 @@ partial void ProcessUpsertToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -189,6 +215,11 @@ partial void ProcessUpsertToolResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -206,6 +237,8 @@ partial void ProcessUpsertToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -215,8 +248,7 @@ partial void ProcessUpsertToolResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -225,6 +257,11 @@ partial void ProcessUpsertToolResponseContent( __attempt < __maxAttempts && global::Letta.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::Letta.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::Letta.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::Letta.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -241,14 +278,15 @@ partial void ProcessUpsertToolResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::Letta.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -288,6 +326,8 @@ partial void ProcessUpsertToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -308,6 +348,8 @@ partial void ProcessUpsertToolResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -370,9 +412,13 @@ partial void ProcessUpsertToolResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Letta.Tool.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -400,9 +446,13 @@ partial void ProcessUpsertToolResponseContent( #endif ).ConfigureAwait(false); - return - await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Letta.Tool.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Letta.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Letta.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/Letta/Generated/Letta.ToolsClient.g.cs b/src/libs/Letta/Generated/Letta.ToolsClient.g.cs index 8acee90c..ad9b98c7 100644 --- a/src/libs/Letta/Generated/Letta.ToolsClient.g.cs +++ b/src/libs/Letta/Generated/Letta.ToolsClient.g.cs @@ -103,10 +103,10 @@ public ToolsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ToolsClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::Letta.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::Letta.AutoSDKClientOptions? options, bool disposeHttpClient = true) {